VMware – Upgrade ESXi Host with ESXCLI (Online and Offline)

This article focuses on how to upgrade an HP ProLiant Gen10 server from ESXi v6.5 to v6.7 using ESXCLI but could be used for any supported upgrade. Online and Offline methods are both shown.

Review the correct version VMware ESXi Upgrade documentation to ensure any pre-requisites are identified/actioned, that the system hardware complies with ESXi requirements of the new version, ensure any SAN is disconnected to name a few.

Official – v6.7 upgrade instructions – https://docs.vmware.com/en/VMware-vSphere/6.7/vsphere-esxi-67-upgrade-guide.pdf

Drain all the VM’s off the host by putting it into maintenance mode.

If you use DRS, you may want to turn it off on the cluster or set it to manual/partial to control the movement of VM’s when the host comes out of maintenance mode

SSH to the host

To check the image profile that you have installed run the following command,

esxcli software profile get

Allow HTTP (If blocked) – Only required for Online upgrade

esxcli network firewall ruleset set -e true -r httpClient

List profiles – Online

esxcli software sources profile list --depot=https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

Use grep to filter the list for your version,

esxcli software sources profile list --depot=https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep -i ESXi-6.7

List profiles – Offline (For example if you wanted to update a custom image)

Download the custom image zip file from the vendor, verify the checksum and add to the hosts local datastore

You should be able to verify you see the zip file using

ls /vmfs/volumes/<datastore>/

Show the profile list/name by running

esxcli software sources profile list --depot=/vmfs/volumes/<Datastore>/VMware-ESXi-6.7.0-17167734-HPE-Gen9plus-670.U3.10.6.3.8-Jan2021-depot.zip

Install chosen profile (Online)

esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.7.0-20201103001-standard

Install chosen profile (Offline)

Run the following command replacing <Datastore> with your datastore you verified earlier

esxcli software profile update --depot=/vmfs/volumes/<Datastore>/VMware-ESXi-6.7.0-17167734-HPE-Gen9plus-670.U3.10.6.3.8-Jan2021-depot.zip --profile=HPE-ESXi-6.7.0-Update3-Gen9plus-670.U3.10.6.3.8

Allow a few minutes for the update to install, once it has completed, scroll up in your SSH session to ensure it completed successfully and that it needs a reboot

Disable HTTP Rule (If you enabled it earlier)

esxcli network firewall ruleset set -e false -r httpClient

Reboot

reboot

After host has come back up check the following,

  • Ensure the predefined ‘Critical Host Patch Baseline’ is attached and check compliance, if any updates are missing ensure it is remediated until compliant
  • Check Monitor > Hardware Health
  • Check Monitor > Skyline Health (Ensure the Retest is post upgrade), resolve any issues

Providing all is well the host can be taken out of maintenance mode, tested with a single VM then moved back into production.

Revert DRS back to original setting if you adjusted it earlier.

Archives