Updating VMware ESXi

At times it is necessary to update the ESXi hypervisor. I found it relatively easy to work with the command line interface, as it offers opportunities for scripting at the same time. VMwares website can be a bit tricky to navigate, so some links are provided for convenience, I work with version 6.0.0 here. The process I followed below.

Install the VMware vSphere CLI

Download and install the CLI from VMware vSphere CLI v6.0.0

Perform a configuration backup

Ideally you would perform a full backup of all virtual machines before. Then back up the configuration of your hypervisor so you can restore via the original image if needed. On the command line that you open via the start menu on Windows for example, type:

vicfg-cfgbackup.pl --server==10.10.1.1 --username=root -s C:\Backup\esxi_60_cfg.2016-03-09

Download the patch

Download the patch from VMware: https://my.vmware.com/group/vmware/patch#search

In my case it was a major update as a zip file of a little over 300MB. Upload that patch file to a datastore on the server via the GUI for example (right click the datastore line in the summary page).

Check the contents of the patch:

esxcli.exe --server=10.10.1.1 --user=root software sources vib get --depot=[ds]updates/ESXi600-201511001.zip

If the certificate is a unsigned certificate, an error will show and the following parameter will need to be added:

--thumbprint AA:...:AA

Prepare the system

While still in the GUI after the upload, turn all VM’s off and enter the maintenance mode (right click on the server).

Just for inventory purposes, note all the installed packages. As noted earlier, the thumbprint parameter allows to proceed with a certificate that has not been installed on the machine:

esxcli.exe --server=10.10.1.1 --thumbprint AA:...:AA --user=root software vib list

Update and reboot

Perform a dry run of the update. As I use third-party ESXi images, I use the update command so it will not overwrite all packages explicitly as the install command would.

esxcli.exe --server=10.10.1.1 --thumbprint AA:...:AA --user=root software vib update --dry-run --depot=[ds]updates/ESXi600-201511001.zip

After ensuring the dry run competed well, remove the dry run argument and proceed for the whole update. Then reboot the system, exit maintenance mode and start the VM’s as usual.

Alternatively, if you log in via ssh to the ESXi host, you can perform the same from within the system by executing the following from the directory of Patch.zip:

esxcli software vib update -d "`pwd`/Patch.zip"

For completeness, I also verified the system profile:

esxcli.exe --server=10.10.1.1 --thumbprint AA:...:AA --user=root software profile get

Leave a comment