Wednesday, November 17, 2010

How to Cancel a Stuck VMware Tools Install

Some co-worker ran into a problem with not able to VMotion a VM off a vSphere host. The error is “The virtual machine is installing VMware Tools and cannot initiate a migration operation.” Right click to “End VMware tools install” won’t help. After some digging, we found it can be resolved in two ways.
1) Click on the VM, go to the toolbar on the top in vSphere client, click on the CD/DVD icon -> CD/DVD Drive 1-> disconnect. This should resolve the issue and you should be able to VMotion this VM after this. This mostly happens to a Linux VM after it upgrades its VMware tools.

2) Found this in Bob Plankers’ The Lone Sysadmin blog. It works great too.
First, you need the ID of the VM (all on one line if it wraps):
/usr/bin/vmware-cmd /vmfs/volumes/datastore-name/vm-folder/vmx-file.vmx getid
Then you can do a:
/usr/bin/vmware-vim-cmd vmsvc/tools.cancelinstall idnumber


Anonymous said...

Alternate way using PowerCLI.

get-vm "VMname" | Dismount-Tools

Unknown said...

Thanks for the PowerCLI tip. In my case, the installation wasn't hung (it had actually finished installing), but the VM didn't notify the vCenter. So I either had to power down the VM, and unmount the ISO, or use this PowerCLI command. Needless to say, no downtime with the PowerCLI way. :-)