How to Upgrade from ESXi 6.0 to ESXi 6.7 via SSH and ESXCLI

important
  • You must have ESXi shell access and all of these commands must be executed on the ESXi host.

  • Make sure you have proper internet connection on the ESXi host.

  • Before proceed with the upgrade, you must shutdown ALL VMs and enable host maintenance mode. When done, make sure to exit from host maintenance mode.

1. Preparing the ESXi Host for Upgrade

1.1. Access ESXi console and verify configurations such as DNS.

dcui

1.2. Get a list of all registered virtual machines and notedown its VMIDs.

vim-cmd vmsvc/getallvms

1.3. Get the current state of a virtual machine by running the following command.

vim-cmd vmsvc/power.getstate VMID

1.4. Shutdown ALL virtual machines using VMIDs.

vim-cmd vmsvc/power.shutdown VMID

1.5. If a virtual machine fails to shut down gracefully, power it off.

vim-cmd vmsvc/power.off VMID

1.6. When the ALL VMs are in shutdown state, enable host maintenance mode. If this is failing make sure that there are no running VMs on the ESXi host.

vim-cmd /hostsvc/maintenance_mode_enter

2. Upgrade the ESXi Host

2.1. Allow HTTP traffic through the firewall.

esxcli network firewall ruleset set -e true -r httpClient

2.2. Check VMware online depot for ESXi 6.7 profiles.

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

2.3. Upgrade to the latest ESXi version.

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

2.4. Revoke HTTP access through the firewall.

esxcli network firewall ruleset set -e false -r httpClient

2.5. Exit from host maintenance mode.

vim-cmd /hostsvc/maintenance_mode_exit

2.6. Reboot the server

reboot
tip

Once the ESXi host is rebooted, please make sure to power on VMs if it is not configured to power on automatically.

3. References

  1. How to Upgrade ESXi 6.0 to 6.5 via CLI
Last updated on by Yasitha Bogamuwa