hashicorp / packer-plugin-vsphere

Packer plugin for VMware vSphere Builder
https://www.packer.io/docs/builders/vsphere
Mozilla Public License 2.0
93 stars 91 forks source link

`vsphere-iso` : problem with VMX `bios.hddOrder` and `bios.bootOrder` with EFI #360

Closed BDelacour closed 6 months ago

BDelacour commented 6 months ago

Hello ! :)

Overview of the Issue

When I create a template using Packer, the bios options in .vmx file are misconfigured and my template-cloned vms are taking so much time to boot :

bios.hddOrder = "scsi0:0"
bios.bootOrder = "hdd,cdrom,cdrom"

When I create my template manually, boot options are not present at all in .vmx and boot is instant.

Reproduction Steps

Create a VM with

firmware = "efi-secure"

Reboot it and watch it wait for a long time on the vmware splash screen

Packer Version

Packer v1.10.0

Plugin Version and Builders

packer-plugin-vsphere : v1.2.3

Please select the builder.

VMware vSphere Version

7.0.3 (21784236)

Guest Operating System

Debian 12 x64

Simplified Packer Buildfile

https://gist.github.com/BDelacour/9393e6614bc3b1400333e53b93fff934

I didn't provide my own (a bit sensitive) variables, but here is some variables I'm using at least :

vsphere_cluster = "Cluster1"
vsphere_datastore = "ssd-002908"
vsphere_network = "VM Network"

vm_name = "template-linux-debian-12"
vm_guest_os_type = "other5xLinux64Guest"
vm_guest_os_name = "template-debian-bookworm"
vm_cpu_count = 2
vm_mem_size = 2048
vm_disk_size = 16384
iso_url = "https://cdimage.debian.org/debian-cd/12.4.0/amd64/iso-dvd/debian-12.4.0-amd64-DVD-1.iso"
iso_checksum = "sha256:3a85e04f0bbdf7ba0cdd7537dd781c583f70754db67e5a757f113442cade56ea"

Operating System and Environment Details

macOS Ventura (Intel)

Log Fragments and crash.log Files

No crash but here are the logs : https://gist.github.com/BDelacour/64c14d783d02b67e2b338a3636f32106

tenthirtyam commented 6 months ago

Appears that the example provided is from vmware-samples/packer-examples-for-vsphere which I maintain. Can you confirm? If so, does it occur on other examples?

BDelacour commented 6 months ago

Appears that the example provided is from vmware-samples/packer-examples-for-vsphere which I maintain. Can you confirm? If so, does it occur on other examples?

Hello @tenthirtyam, first of all, thank you for your work and for your message. And yes, I confirm I used your repo 👼 I just tested the Ubuntu 22.04 example, it is working well and VMX options are present but they don't create a problem, so it is not a plugin bug after all.

So it must be the way the OS is installed, the partitioning or something like that...

Do you want me to create an issue on https://github.com/vmware-samples/packer-examples-for-vsphere instead ?

BDelacour commented 6 months ago

I just updated my preseed in my gist (https://gist.github.com/BDelacour/9393e6614bc3b1400333e53b93fff934) to have something more similar with the one from the example, but no change (I use ext2 instead of xfs for /boot but I doubt it can be a problem)

tenthirtyam commented 6 months ago

Yes, it would be best to open an issue on the examples repo instead I think.

BDelacour commented 6 months ago

Transfered to : https://github.com/vmware-samples/packer-examples-for-vsphere/issues/814