While installing VM tools, on one of the virtual machines tools installation task was getting hung.
Was not able to cancel the task using vCenter or directly connecting to the host. Due to this all the features like Snapshot, Migrate were disabled on the VM.
To kill the VM tools installation task through command line, we need to identify VMID and kill the vm tools insall for the corresponding VM.
Please follow the below steps. (applicable to ESXi).
1. Enable ssh on the host holding the VM.
2. Login to the host using SSH client. eg., Putty
3. Run the command line /usr/bin/vim-cmd vmsvc/getallvms
This will return list of the VMs with VM ID. Then run the below command to kill the VM tools install process for the VM facing issue.
4. /usr/bin/vim-cmd vmsvc/tools.cancelinstall VMID
Hope this quickly helps in getting the VM back to normal.
--Alternate way of achieving the same using PowerCLI would be:
get-vm "VMname" | Dismount-Tools
Thanks!