search
top

Updating VMWare ESXi Hypervisor 5

Recently I built a VMWare ESXi Hypervisor 5 server for testing and learning purposes. As a good admin you must always patch and VMWare is no exception.

First download and install VMWare vCLI from http://www.vmware.com/support/developer/vcli/. You must have an account on VMWare to download the products, the account is free. I will be using vCLI installed on Windows 7 x64 Professional, so the path maybe different on your installation.

Now Download the latest patch from http://www.vmware.com/patchmgr/findPatch.portal. The current patch is ESXi500-201204001.zip. Once you have downloaded the latest patch copy it to a datastore on the ESXi 5 server or a place the server to patch has access to, for this post I am using /vmfs/volumes1/datastore2/updates. Download the zip file and do not extract it. Open vCLI session.

First we need to see if the server needs to be in Maintenance Mode for the patch, issue the following command:

esxcli --server=192.168.1.80 --username=root software sources vib get -d /vmfs/volumes/datastore2/updates/ESXi500-201204001.zip | grep "Maintenance Mode Required: True"

If grep returns a True then lets put it in maintenance mode, issue the following command:

"C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\bin\perl" vicfg-hostops.pl --server 192.168.1.80 --operation enter

Verify the host is in maintenance mode,issue the following command:

"C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\bin\perl" vicfg-hostops.pl --server=192.168.1.80 --operation info

Verify what vib’s are installed, issue the following command:

esxcli --server=192.168.1.80 --username=root software vib list | more

To find out which VIBs are available in the depot (the downloaded .zip file), issue the following command:

esxcli --server=192.168.1.80 --username=root software sources vib list --depot=/vmfs/volumes/datastore2/updates/ESXi500-201204001.zip | more

To update the ESXi 5 host with the VIBs included in the depot, issue the following command:

esxcli --server=192.168.1.80 --username=root software vib update --depot=/vmfs/volumes/datastore2/updates/ESXi500-201204001.zip

When the update is complete, verify the information presented. If prompted, reboot the ESXi 5 host by issuing the following command:

"C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\bin\perl" vicfg-hostops.pl --server 192.168.1.80 --operation reboot

Verify the patch bundle was installed, by issuing the following command:

esxcli --server=192.168.1.80 --username=root software vib list | more

If applicable, take the ESXi 5 host out of maintenance mode using the vSphere Client or with the following command:

"C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\bin\perl" vicfg-hostops.pl --server 192.168.1.80 --operation exit

If the operation  exit command fails just open vSphere client and remove the server from Maintenance mode and un-pause the vm’s on the server.

Note: All of this can be done from a Linux system as well. VMWare provides a Linux vCLI download as well. The difference in the commands is that the perl preface used for Windows can be omitted as well as the .pl on the end of the command.

One Response to “Updating VMWare ESXi Hypervisor 5”

Leave a Reply

Your email address will not be published. Required fields are marked *

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

top