Added logic to the vmware-iso builder that appends the number of cores per socket to the vmx in `stepCreateVmx`.
This commit is contained in:
parent
062c62eed8
commit
4894873971
|
@ -429,12 +429,19 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist
|
|||
s.tempDir = vmxDir
|
||||
}
|
||||
|
||||
/// Now to handle options that will modify the template
|
||||
/// Now to handle options that will modify the template without using "vmxTemplateData"
|
||||
vmxData := vmwcommon.ParseVMX(vmxContents)
|
||||
|
||||
// If no cpus were specified, then remove the entry to use the default
|
||||
if vmxData["numvcpus"] == "" {
|
||||
delete(vmxData, "numvcpus")
|
||||
}
|
||||
|
||||
// If some number of cores were specified, then update "cpuid.coresPerSocket" with the requested value
|
||||
if config.HWConfig.CoreCount > 0 {
|
||||
vmxData["cpuid.corespersocket"] = strconv.Itoa(config.HWConfig.CoreCount)
|
||||
}
|
||||
|
||||
/// Write the vmxData to the vmxPath
|
||||
vmxPath := filepath.Join(vmxDir, config.VMName+".vmx")
|
||||
if err := vmwcommon.WriteVMX(vmxPath, vmxData); err != nil {
|
||||
|
|
Loading…
Reference in New Issue