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
Final Thoughts
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.
Is there no way to put the host in maintenance mode from the command line?
Jason,
Sure is…you can use esxcli in an ssh session – esxcli system maintenanceMode….or you can use powercli – Set-VMHost -VMHost Host -State “Maintenance”
this is valid for customized versions?
Yes, this should also work for customized images ***IF*** you are doing an UPDATE and not INSTALL. Update will keep the customized drivers.
great!!! it works!!!