This article provides steps to change the boot device without using the virtual machine's BIOS and its limitation to 8 visible devices.
Shut down the virtual machine.
Click the virtual machine in the Inventory.
Right click Edit Settings.
In the Virtual Machine Properties dialog, click the VM Options tab.
Under Boot Options, select the check box for Force BIOS setup.
Click OK to save the changes.
Power on the virtual machine
Open a VM console and navigate to the BIOS > Boot section
Make your boot order selection and save
You can also choose the boot device using the virtual machine advanced options bios.bootOrder and bios.hddOrder. These settings override the boot order that you might have set in the virtual machine's BIOS previously.
The virtual machine's boot order can be set to any virtual NIC ethernetX, where X is the number of the device. For example, ethernet0 or ethernet5. It can also be set to hdd, cdrom, or floppy. If set to cdrom or floppy there are multiple devices, the virtual machine tries them sequentially until it finds one to boot from. If bios.bootOrder is set to hdd, you also need to define bios.hddOrder and set a device (for example, scsi0:3 or ide1:0) to boot from.
To make this change, ensure that the virtual machine is currently in powered off state, then:
Right-click the VM in vSphere Client.
Select Edit Settings.
In the VM Options tab, select Advanced.
Next to Configuration Parameters, click on EDIT CONFIGURATION.
Select [ADD CONFIGURATION PARAMS] to create the new VM advanced parameters:
Name | Value |
bios.bootOrder
|
ethernet5,ethernet2,hdd,cdrom,floppy
|
bios.hddOrder
|
scsi2:2,scsi0:1,ide1:0
|
Click [OK], then [OK] again to save the change and exit the VM settings wizard.
You can also configure the list of devices by editing the VMX configuration file. Ensure that the VM is currently powered off for this. When adding the settings in the VMX file, make sure to put the device list(s) into quotation marks and separate the devices with commas.
For example:
bios.bootOrder = "ethernet5,ethernet2,hdd,cdrom,floppy"
bios.hddOrder = "scsi2:2,scsi0:1,ide1:0"
In this example, the virtual machine tries to boot with ethernet5. If there is nothing to boot from, try ethernet2. If that fails, try from the disks (hdd) defined in hddOrder, then all CD-ROMs, and finally from all floppies.
Note: Adding these advanced options can block you from changing the boot order in the BIOS setup. Should you experience this, and wish to be able to use the BIOS to make boot order changes, remove both options while the VM is in powered off state. The next time the VM is powered on, it will use the boot order which was originally configured in the BIOS setup.
$strVMName = "vm-name"
$strBootNICDeviceName = "Network adapter 1"
$strBootHDiskDeviceName = "Hard disk 1"
$viewVM = Get-View -ViewType VirtualMachine -Property Name, Config.Hardware.Device -Filter @{"Name" = "^$strVMName$"}
$intNICDeviceKey = ($viewVM.Config.Hardware.Device | ?{$_.DeviceInfo.Label -eq $strBootNICDeviceName}).Key
$oBootableNIC = New-Object -TypeName VMware.Vim.VirtualMachineBootOptionsBootableEthernetDevice -Property @{"DeviceKey" = $intNICDeviceKey}
$intHDiskDeviceKey = ($viewVM.Config.Hardware.Device | ?{$_.DeviceInfo.Label -eq $strBootHDiskDeviceName}).Key
$oBootableHDisk = New-Object -TypeName VMware.Vim.VirtualMachineBootOptionsBootableDiskDevice -Property @{"DeviceKey" = $intHDiskDeviceKey}
$oBootableCDRom = New-Object -Type VMware.Vim.VirtualMachineBootOptionsBootableCdromDevice
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec -Property @{
"BootOptions" = New-Object VMware.Vim.VirtualMachineBootOptions -Property @{
BootOrder = $oBootableNIC, $oBootableCDRom, $oBootableHDisk
}
}
$viewVM.ReconfigVM_Task($spec)
$vm = Get-VM vm-name; $vm.ExtensionData.Config.BootOptions | Select BootOrder
Note: The settings in this article override the boot order configuration in the BIOS. When you add these settings, changing the boot order in the virtual machine BIOS will be blocked. Therefore to use the BIOS UI for changing the boot order, you will need to remove the bios.bootOrder and bios.hddOrder if they exist.