Open ravik694 opened 3 years ago
is there any update on this
Status can be viewed in the attached milestone; however, community contributions are welcome and help to accelerate features.
Some additional info from a working custom module (not Terraform, not Go):
The supported API way of configuring the boot order is via VirtualMachineBootOptions(vim.vm.BootOptions)
in VirtualMachineConfigSpec(vim.vm.ConfigSpec)
. This works both at creation time as well as during reconfiguration.
BootOptions allow setting additional very useful booleans, that should also be exposed by the provider, most notably, bootDelay
, efiSecureBootEnabled
, networkBootProtocol
(PXE over IPv4 or IPv6).
The bootOrder array can only be populated with full knowledge of the deviceKeys of the underlying bootable device.
References ========
The behaviour of VMs created by this provider is non-deterministic and without this feature implemented cannot be made deterministic. If you create an EFI VM with only NICs and then make Terraform reconfigure it to have NICs and CDs, the boot order will be first NIC, then CD. If you create an EFI VM with NICs and CDs, the boot order will be first CD, then NIC. This breaks one of the promises of Terraform to ensure a consistent target state.
Tested with Terraform v1.4.0, vsphere v2.3.1 against ESXi-7.0U3j-21053776-standard.
Some additional info from a working custom module (not Terraform, not Go):
The supported API way of configuring the boot order is via
VirtualMachineBootOptions(vim.vm.BootOptions)
inVirtualMachineConfigSpec(vim.vm.ConfigSpec)
. This works both at creation time as well as during reconfiguration.BootOptions allow setting additional very useful booleans, that should also be exposed by the provider, most notably,
bootDelay
,efiSecureBootEnabled
,networkBootProtocol
(PXE over IPv4 or IPv6). The bootOrder array can only be populated with full knowledge of the deviceKeys of the underlying bootable device.References
Secure boot is exposed in vsphere_virtual_machine, a good starting point would probably be looking there to make a pr. Looking at this this is acutally a trival patch and just needs the schema updated with the exposed boot options in govmomi.
Basically add to schema in virtual_machine_config_structure.go, change https://github.com/vmware/govmomi/blob/6687830863b6607134e359991c48fd758fc8f9ed/govc/device/boot.go#L42 to add the new schema options.
Description
It would be nice to have the ability to set the VM boot sequence through the
vsphere_virtual_machine
resource.I've attempted setting this through the
extra_config
argument with thebios.bootOrder / bios.hddOrder
parameters but the changes don't "stick" after applying the config. The same thing happens when trying to set the options through the ESXi web UI (VM -> Edit -> VM Options -> Advanced -> Edit Configuration.) The settings disappear after clicking Save. The settings do seem to be honored when I manually edit the .vmx file of the VM on the ESXi server.Current example (
extra_config
settings are shown interrraform plan
andterraform apply
but are not reflected in the VM config on ESXi):Potential Terraform Configuration
References
bios.bootOrder / bios.hddOrder
parameters and how to set them (but does not work for me when I use the ESXI web UI.)bootOrder
parameter ofvim.vm.BootOptions
object,govc device.boot -vm $vm -delay 1000 -order floppy,cdrom,ethernet,disk
boot_order
parameter with examples.My ESXi server (paid license) details:
Community Note