From vSphere 7.0, VMware introduced a utility to manage the boot device order from ESXi when system firmware runs in UEFI boot mode. The ability to manage the boot device(s) with in ESXi gives the option to alter the boot order for subsequent boots if needed. This may be a handy option for administrators who doesn't have remote console access for a given server but wants to change the boot device for specific requirements.
/usr/lib/vmware/uefi/bin/bootorder is the EFI utility VMware provided to manage the boot variables with in ESXi. There is a help page provided too along with the utility where all the options can be seen using ‘-h’ parameter.
As an example, below demonstrates some of the parameters that the utility provides using which you can view the current boot device, list all boot devices enabled on the system, set one-time next boot option etc.
As a first step, check if the system firmware runs in UEFI boot mode. From ESXi, you may check the same using 'vsish -e get /hardware/firmwareType'. This command returns either 'Legacy BIOS' or 'UEFI' depending upon what's set by the administrator.
If the system boot mode is set to 'UEFI', below are some of the options provided by /usr/lib/vmware/uefi/bin/bootorder utility to monitor and manage the boot device order.
~] /usr/lib/vmware/uefi/bin/bootorder -l # This command Provides a list of boot device(s) enabled on the system.
Boot0004: VMware ESXi
Boot0003: Embedded NIC 1 Port 1 Partition 1
Boot0001: Virtual Floppy
Boot0002: Virtual CD
Below is an explicit option to fetch the current boot device in addition to the above command as below.
~] /usr/lib/vmware/uefi/bin/bootorder -c # Shows the current boot device.
Boot0004: VMware ESXi
One another useful option is setting one-time next boot options using -x parameter so that it sets the designated boot device in the next immediate boot. In this example above, you may use the integer value for the corresponding boot device that you want to set for the next boot.
~] /usr/lib/vmware/uefi/bin/bootorder -x 3 # This sets the one-time next boot.
~] /usr/lib/vmware/uefi/bin/bootorder -n # This parameter shows the one-time next boot option set.
Boot0003: Embedded NIC 1 Port 1 Partition 1
This helps a user to manage the system boot variables when one wants to alter the boot devices with in ESXi.