hashicorp / packer-plugin-vmware

Packer plugin for VMware Builder
https://www.packer.io/docs/builders/vmware
Mozilla Public License 2.0
46 stars 41 forks source link

`vmware-vmx`: cd_files, cd_content not working for ARM guests #182

Open eszense opened 4 months ago

eszense commented 4 months ago

Description

Current default for Packer configured CD (cd_files, cd_content) is to use the IDE adapter. However, this would not work for ARM guest since IDE is not supported by VMware in these guests (https://kb.vmware.com/s/article/90364). It appears desirable to change the default to SATA for ARM guest. There is currently no config to change the cdrom adapter for vmware-vmx because the cdrom_adapter_type config is only exposed in vmware-iso but not vmware-vmx

Use Case(s)

cloud-init for ARM guest on VMware Fusion on all Apple Silicon host

tenthirtyam commented 1 month ago

Potential solution when generating the VMX:

func DefaultDiskAndCDROMTypes(diskAdapterType string, cdromAdapterType string) DiskAndCDConfigData {
    diskData := DiskAndCDConfigData{
        SCSI_Present:         "FALSE",
        SCSI_diskAdapterType: "lsilogic",
        SATA_Present:         "FALSE",
        NVME_Present:         "FALSE",

        DiskType:                   "scsi",
        CDROMType:                  "ide",
        CDROMType_PrimarySecondary: "0",
    }

   // If arm64, default to sata.
    if runtime.GOARCH == "arm64" {
        diskData.CDROMType = "sata"
    }

   // rest of function...