VMware ESXi 5 – Applying Patches and Updates

(ESXi 5 Update 1 and Patches)

KB ID 0000623

Problem

When VMware released ESX 4.1, they took away the “Host update utility”, (which was a mistake!). For people without VMware Update Manager, you now have to either put in the CD/DVD and do an ‘in place upgrade’, or grow a ginger pony tail and put some socks/sandals on and do some Linux.

Below I’ve got a build of ESX with no updates on it, I’m going to apply the ‘Update 1″ then the most recent patch to bring the host up to date (at time of writing).

Solution

1. Whilst connected to your host with the VI client > Select the host > Configuration > Security Profile > Services Section > Properties > SSH > Options >Start > OK > OK > Exit the VI client.

2. Connect to the host via an SSH command window (PuTTy shown). Log on as the root user, to check your current ‘build’ version issue the following command;

[box]vmware -v[/box]

3. You should have a fair idea what piece of storage has the most free space already, this host only has one datastore (datastore1). That’s the one I’m going to download the updates into. To view the Datastores issue the following command;

[box]ls -l /vmfs/volumes/[/box]

4. Change directory, so that you are ‘in’ that datastore and create a directory called ‘UPDATE’.

[box]cd /vmfs/volumes/datastore1<br /> mkdir UPDATE[/box]

5. Then change into that directory;

[box]cd UPDATE[/box]

6. From a browser visit the VMware patch portal, locate the update you want to download and install, (here it’s VMware 5.0.0 Update1). Right click the download link and copy the URL.

Note: Patches after major updates are cumulative, I also downloaded the ‘latest’ patch.

7. You need to remove the ‘s’ from the URL, I just paste the link into notepad, edit it then copy it again.

8. Back at your command window download the update with the following command;

[box]wget http://hostupdate.vmware.com/software/VUM/OFFLINE/release-328-20120312-212851/update-from-esxi5.0-5.0_update01.zip[/box]

9. When completed, download any other required patches;

[box]wget http://hostupdate.vmware.com/software/VUM/OFFLINE/release-341-20120605-165537/ESXi500-201206001.zip[/box]

10. Before applying the update/patches, the host needs to be in maintenance mode;

[box]vim-cmd hostsvc/maintenance_mode_enter[/box]

11. Then apply the update with the ‘esxcli’ command as follows;

[box]esxcli software vib install -d /vmfs/volumes/datastore1/UPDATE/update-from-esxi5.0-5.0_update01.zip[/box]

12. When complete, you will need to ‘scroll up’ and make sure it says, “Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.”

13. After the update, I am applying the latest patch with the same esxcli syntax, like so;

[box]esxcli software vib install -d /vmfs/volumes/datastore1/UPDATE/ESXi500-201206001.zip[/box]

14. Once again you will need to ‘scroll up’ and locate, “Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.”

15. Now reboot the host;

[box]reboot[/box]

16. Once the host is back online, connect and take it out of maintenance mode.

17. Then locate the folder containing the update software and patches.

18. And delete it.

19. Finally power your guest machines back on again.

Related Articles, References, Credits, or External Links

Enable SSH Access to vSphere ESXi

Upgrade vSphere 4 Environment to vSphere 5

Update VMware ESXi from 4.0 to 4.1

Upgrade ESX 3 to version 4.1.0

vSphere – Virtual Machine Will Not ‘Power Off’ (Hangs at 95%)

KB ID 0000911 

Problem

I had a virtual machine crash on me, while I was doing some work on it As I was unable to shut it down gracefully, I attempted to ‘Power Off’. It progressed to 95% and stopped there.

Expecting it to ‘time out’, I carried on with some other work and kept an eye on it. 30 minutes later there was still no progress.

Solution

1. Enable SSH access on the ESX host that is hosting the problem VM.

2. Connect to the ESX host via SSH, and logon as root. Execute the following command to see all the running VMs on this host, and list their world ID numbers.

[box]

esxcli vm process list[/box]

 

3. Once you have the World ID of the problem VM, you can attempt to power it off with the following command;

[box]

Syntax

esxcli vm process kill --type {soft,hard,force} --world-id {ID Number}
Example

esxcli vm process kill –type hard –world-id 1397444

 

[/box]

4. Check, and your VM should now be powered off.

If That Didn’t Work (How to Kill a VM)

Note: This is a last resort.

1. Issue the following command to locate the Process ID’s that are associated with the problem VM.

[box]

Syntax

ps | grep "VM Name"

Example

ps | grep "2012 Test"

[/box]

You will get all the processes, and they are preceded by two columns of numbers, the first column contains the individual PID’s. The second column is the PID for the parent process, this is the one you need.

2. Armed with your PID, you need to terminate that parent process with the following command;

[box]

Syntax

kill {PID}
Example

kill 1398644

[/box]

3. Check, and your VM should now be powered off.

Related Articles, References, Credits, or External Links

NA