Update VMWare ESXi from Shell

Do you know the feeling of creating USB drives to update/upgrade your VM hosts?

Stop!, You can do this now from the CLI!

I will explain you how to do this.

Login and Upgrade

First login to your VMWare web interface

Stop all running VMs, after all VMs are succesfully stopped Enter Maintenance Mode.

Next, we are going to enable Secure Shell access.

you can use PuTTy to connect to your VMWare shell.
#Enable http download in firewall

esxcli network firewall ruleset set -e true -r httpClient

List Available Patches

With this command you can list all available patches for ESXi-6.5.xxxx

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

Upgrade your VM Host

To upgrade to the latest version listed from the command above you use:

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

Error no space left

When you receive a error “No Space Left”

#Error no space left
[root@ESXI:~] esxcli software profile update -p ESXi-6.5.0-20180304001-standard -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
[InstallationError]
[Errno 28] No space left on device
vibs = VMware_locker_tools-light_6.5.0-1.33.7273056
Please refer to the log file for more details.

Enabling SWAP Configuration

You must enable SWAP configuration from the Manage, System menu in your VMWare web interface.

Run the above command again (esxcli software profile update -p ESXi-6.5.0-20180304001-standard -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml)

Finish Up

After the system successfully is upgraded, Exit Maintenance from the VMWare Web Interface and type “reboot” in the SSH Session.

Your system is now fully patched, make sure you turn on your VMs again if you do not set it automatically.

 

You may also like..

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.