Friday, May 17, 2019

Fix Stuck VMware Tools Install

When automatic VMware tools upgrades is enabled in vCenter, sometimes the ISO will unmount before the installer notifies vCenter that the installation is done.  This will cause vCenter, and the host the VM is registered on, to think that VMware tools installation is still in progress even though it is complete.  The VM will be left in a state where it can't migrate, which means the host is unable to enter maintenance mode.  To fix this, we need to manually kill the process within ESXi that is running the stuck tools installation.

Start by enabling SSH on the affected host, then use Putty (or the SSH client of your choice) and login to the host.  Run the commands below to get the process ID for the affected VM and then to kill the installation process.

Within your SSH session, run the command:

vim-cmd vmscv/getallvms

Find the VMID of the VM with the stuck tools installation and run the command:

vim-cmd vmsvc/tools.cancelinstall id_number

Replace "id_number" with the correct VMID found with the first command.  This will kill the VMware tools installation process allowing the VM to be moved with vMotion and the host to enter maintenance mode.