How to update an ESXi 6.0 host from commandline
The process of updating an ESXi 6.0 host from commandline is a very painless operation. Especially if you have a standalone host and don’t have access to VUM for updates, this procedure works well for me to get the latest updates, and then apply the update. Let’s take a look at how to update an ESXi 6.0 host from commandline.
First things first, we need to place the host in maintenance mode. From the vSphere client, simply right-click the host and select Enter Maintenance Mode.
- After successfully going into maintenance mode, you will see this designated in vSphere client
Next, we issue a series of commands to successfully update the host:
esxcli network firewall ruleset set -e true -r httpClient esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep 6.0.0-2015 esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.0.0-20150404001-standard
The second command above adds the grep command to narrow down on the updates that we want to display. If you don’t grep for a specific version, you will see a huge list of updates which can get confusing if you are trying to parse through and choose the correct one. The above commands are executed in successive order and results will look similar to below:
You will see the note above if you scroll up in the commandline results that the update completed successfully, but the system needs to be rebooted for the changes to be effective. After you see that message you are good to issue the reboot command.
After the host reboots, verify the new version of the host:
- Old version number
- New version number
The final step in the process is to exit maintenance mode on the host. Simply right click again on the host and choose Exit Maintenance Mode
So far I have never ran into an issue updating standalone hosts this way. The update process has always been rock solid. Let me know your thoughts in comments section if you guys have any other tips to share on the standalone update process from commandline.