|
|
|
|
@ -21,6 +21,8 @@ type vmxTemplateData struct {
|
|
|
|
|
ISOPath string
|
|
|
|
|
Version string
|
|
|
|
|
|
|
|
|
|
HDD_BootOrder string
|
|
|
|
|
|
|
|
|
|
SCSI_Present string
|
|
|
|
|
SCSI_diskAdapterType string
|
|
|
|
|
SATA_Present string
|
|
|
|
|
@ -382,6 +384,7 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist
|
|
|
|
|
NVME_Present: "FALSE",
|
|
|
|
|
|
|
|
|
|
DiskType: "scsi",
|
|
|
|
|
HDD_BootOrder: "scsi0:0",
|
|
|
|
|
CDROMType: "ide",
|
|
|
|
|
CDROMType_MasterSlave: "0",
|
|
|
|
|
|
|
|
|
|
@ -396,23 +399,28 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist
|
|
|
|
|
|
|
|
|
|
/// Use the disk adapter type that the user specified to tweak the .vmx
|
|
|
|
|
// Also sync the cdrom adapter type according to what's common for that disk type.
|
|
|
|
|
// XXX: If the cdrom type is modified, make sure to update common/step_clean_vmx.go
|
|
|
|
|
// so that it will regex the correct cdrom device for removal.
|
|
|
|
|
diskAdapterType := strings.ToLower(config.DiskAdapterType)
|
|
|
|
|
switch diskAdapterType {
|
|
|
|
|
case "ide":
|
|
|
|
|
templateData.DiskType = "ide"
|
|
|
|
|
templateData.CDROMType = "ide"
|
|
|
|
|
templateData.CDROMType_MasterSlave = "1"
|
|
|
|
|
templateData.HDD_BootOrder = "ide0:0"
|
|
|
|
|
case "sata":
|
|
|
|
|
templateData.SATA_Present = "TRUE"
|
|
|
|
|
templateData.DiskType = "sata"
|
|
|
|
|
templateData.CDROMType = "sata"
|
|
|
|
|
templateData.CDROMType_MasterSlave = "1"
|
|
|
|
|
templateData.HDD_BootOrder = "sata0:0"
|
|
|
|
|
case "nvme":
|
|
|
|
|
templateData.NVME_Present = "TRUE"
|
|
|
|
|
templateData.DiskType = "nvme"
|
|
|
|
|
templateData.SATA_Present = "TRUE"
|
|
|
|
|
templateData.CDROMType = "sata"
|
|
|
|
|
templateData.CDROMType_MasterSlave = "0"
|
|
|
|
|
templateData.HDD_BootOrder = "nvme0:0"
|
|
|
|
|
case "scsi":
|
|
|
|
|
diskAdapterType = "lsilogic"
|
|
|
|
|
fallthrough
|
|
|
|
|
@ -422,6 +430,7 @@ func (s *stepCreateVMX) Run(_ context.Context, state multistep.StateBag) multist
|
|
|
|
|
templateData.DiskType = "scsi"
|
|
|
|
|
templateData.CDROMType = "ide"
|
|
|
|
|
templateData.CDROMType_MasterSlave = "0"
|
|
|
|
|
templateData.HDD_BootOrder = "scsi0:0"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Handle the cdrom adapter type. If the disk adapter type and the
|
|
|
|
|
@ -641,7 +650,8 @@ func (s *stepCreateVMX) Cleanup(multistep.StateBag) {
|
|
|
|
|
// do so by specifying in the builder configuration.
|
|
|
|
|
const DefaultVMXTemplate = `
|
|
|
|
|
.encoding = "UTF-8"
|
|
|
|
|
bios.bootOrder = "hdd,CDROM"
|
|
|
|
|
bios.bootOrder = "hdd,cdrom"
|
|
|
|
|
bios.hddOrder = "{{ .HDD_BootOrder }}"
|
|
|
|
|
checkpoint.vmState = ""
|
|
|
|
|
cleanShutdown = "TRUE"
|
|
|
|
|
config.version = "8"
|
|
|
|
|
|