I just replied to a topic on the VMTN forums and thought it might be useful to write it down here as well. (I thought I already did, but a search didn’t turn up anything.)
When a VM gets stuck during shutdown or isn’t responding anymore you can easily kill the VM. First option is the command line version of vCenter’s “shutdown vm”, first list all the VMs running on the host so you can copy and paste the <config> in to the next command. The command “vmware-cmd <config> stop trysoft” will try to initiate a soft shutdown first, in other words a shutdown via the Guest OS, if that doesn’t work it will do a power off. Now, as most of you probably already experienced, sometimes it’s impossible to shutdown the VMs in a normal way. This is where 2nd, 3rd and 4th option come in to place. Option two uses vm-support to kill the VM, use “-x” to list the VM id’s and kill it with “-X”. The third option uses vimsh, in this case we use vmware-vim-cmd, “vmsvc/getallvms” lists all VMs and the id’s and with “vmsvc/poweroff” you can specify the VM that needs to be powered off. The fourth option is the Linux/Unix way of doing it, find the process id of the VM via “ps -auxwww” and just kill it.
-
vmware-cmd -l
vmware-cmd <config> stop trysoft
-
vm-support -x
vm-support -X <vmid>
-
vmware-vim-cmd vmsvc/getallvms
vmware-vim-cmd vmsvc/poweroff <vm id>
-
ps -auxwww | grep <vm name>
kill <process id>
- if option three isn’t successful do the following:
kill -9 <process id>
As VMwareWolf points out, there’s an excellent KB article on this subject to be found here: http://kb.vmware.com/kb/1004340
