Vsphere-iso plugin vm multi disk multi controller

We are trying to use packer to create a template VM with 4 controllers and multiple disks attached to each.

The disk to controller is working, but unfortunately when the OS boots up it scans the disks and will install on the wrong disk.

We believe this is because the OS (linux and windows both) scan the hardware sorting the controllers by their WWN.

These are defined in the vmx:

“scsi0.sasWWID” = “50 05 05 67 ad 2e 69 b0”
“scsi1.sasWWID” = “50 05 05 67 ad 2e 68 b0”
“scsi2.sasWWID” = “50 05 05 67 ad 2e 6b b0”

and as you can see the controller WWIDs are in the wrong order when sorted.

Is it possible to hard code set the WWIds as part of the sphere-iso controller source var?

We tried the configuration_parameters to set the WWIDs but packer just overwrote them. If there was a configuration_parameters_post that allowed modification after before boot that may also work.

Or is there a better way for this?


Do you use .vmdk disk into a datastore or physical lun ?

In this link, you’ll have example to define sort controller/disks, and i guess by default Packer will install on first disk : vSphere ISO - Builders | Packer | HashiCorp Developer

Depends on the OS you want to install (Linux/Windows) maybe you should use a preseed.cfg/kickstart for Debian/CentOS or autounattend.xml for Windows, then use this file in your Packer builder. This kind of file allow you to select disk and properly manage storage and partition.

We ended up creating a single controller single disk vm template using vsphere-iso plugin, then use the vsphere-clone plugin to clone off to more complicated VMs that we add controllers and disks to. We think this works, but so far only have tested with one disk on each controller. The down side appears that we are no longer able to add additional disks to the original first controller unless its done in the first vsphere-iso template.