Patch VMware ESXi 5.x via SSH

patchesxi01

When the VMware vCenter is not available in the virtual network environment, ESXi hosts can be patched using the ESXi Shell via SSH.

You can perform the patching also using vMA but if you put the host in Maintenance Mode, the appliance itself is not available if not installed in a different host. This procedure works also for the free version of vSphere ESXi 5.x.

 

Download patches

Download the patches from VMware website to your local computer.

patchesxi02

 

Copy patches in the storage

When download is complete, open vSphere client and access the host to be patched.

In Summary panel identify the Resources section, right click the storage name then select option Browse Datastore.

patchesxi03

Create a folder named patches, for instance, and copy the patches in the host storage.

patchesxi04

Once all files have been copied, in the right side of the window you can see the list of patches ready to be applied to the host.

patchesxi05

 

Access the system

Shutdown all the running virtual machines and put host in maintenance mode. Note the version number.

patchesxi06

 

Enable services

From Configuration panel, select Software > Security Profile then click Properties.

patchesxi07

Select ESXi Shell and click Options.

patchesxi08

Select Start and stop manually then click Start. Click OK to continue.

patchesxi09

Repeat same steps for SSH service. When finished you should see the enabled services with Daemon Running.

patchesxi10

 

Apply patches

Using a tool like PuTTY, connect the host through SSH.

patchesxi11

Insert the credential to login the system.

patchesxi12

To apply the patches, we use the esxcli command with the syntax:

esxcli software vib update --depot /vmfs/volumes/<StorageName>/<folderName>/file.zip

To identify the Storage name, have a look at Summary > Resources section.

patchesxi13

In this example we are going to apply the following patches:

  • update-from-esxi5.0-5.0_update02.zip
  • ESXi500-201303001.zip
  • ESXi500-201305001.zip

From the host console, type the command and apply the patches. It takes a while so be patience.

# esxcli software vib update --depot /vmfs/volumes/local-vmfs1/patches/update-from-esxi5.0-5.0_update02.zip

patchesxi14

# esxcli software vib update --depot /vmfs/volumes/local-vmfs1/patches/ESXi500-201303001.zip

patchesxi15

# esxcli software vib update --depot /vmfs/volumes/local-vmfs1/patches/ESXi500-201305001.zip

patchesxi16

When all patches have been applied successfully, type the command reboot then press ENTER to reboot the host.

patchesxi17

When host has been rebooted, Exit Maintenance Mode and restart the virtual machines. Note the version number.

patchesxi18

Because ESXi Shell and SSH services were started manually, after rebooting the host they are no longer enabled therefore it is not necessary to stop them.

patch esxi 5 ssh 1