It happened to me the other day, the vm was stuck because another process was locked (a snapshot in my case).
I found out that the best way is this:
1. Log in to ESX console and determine the WorldID with the command:
# vm-support -x
2. Determine the master world ID with the command:
# less -S /proc/vmware/vm/****/cpu/status
or on Vsphere
less -S /proc/vmware/vm/****/names
3. Scroll to the right with the arrow keys until you see the group field. It appears similar to:
Group
vm.****
4. Run the following command to shut the virtual machine down with the group ID:
# /usr/lib/vmware/bin/vmkload_app -k 9 ****
If the preceding steps fail, perform the following steps for an ESX 4.x host:
1. List all running virtual machines to find the vmxCartelID of the affected virtual machine with the command:
# /usr/lib/vmware/bin/vmdumper -l
2. Scroll through the list until you see your virtual machine�s name. The output appears similar to:
vmid=5151 pid=-1 cfgFile=�/vmfs/volumes/4a16a48a-d807aa7e-e674-001e4ffc52e9/mdineeen_test/vm_test.vmx� uuid=�56 4d a6 db 0a e2 e5 3e-a9 2b 31 4b 69 29 15 19? displayName=�vm_test� vmxCartelID=####
3. Run the following command to shut the virtual machine down with the vmxCartelID:
# /usr/lib/vmware/bin/vmkload_app -k 9 ####