How to forcefully kill a virtual machine in VMware ESX
I had an error message come up about a VM:
The redolog of xxxxx.xx.vmdk has been detected to be corrupt. The virtual machine needs to be powered on. If the problem still persists, you need to discard the redolog.
I couldn’t power off the VM and it was stuck in an endless loop prompting me to click okay.
Found a good guide on how to kill the VM without having to power cycle the host.
- SSH to the Host that has the VM running on it.
- We need to run a command to find out the VM ID for the VM having the issue.
cat /proc/vmware/vm/*/names
This will return a line for each VM running.
vmid=1251 pid=-1 cfgFile="/vmfs/volumes/48ee2ea5-0d1d15c7-0d1c-001f2955194d/example/example.vmx" uuid="56 4d 07 c7 3f 85 f9 09-35 56 41 8c e9 e2 54 7b" displayName="example"
So if we wanted to kill the VM called example we will need to take note of the ID, which as you can see above is 1251.
We now need to find out the Master World ID number.
less -s /proc/vmware/vm/1251/cpu/status
A table will then appear. If you scroll to the right you should see a value under group. It will be something like vm.1234.
In this example the number will be 1234.
Run this command to kill it.
/usr/lib/vmware/bin/vmkload_app -k 9 1234
If you got the right number you should see a line come back with
Warning: Apr 22 09:01:35.476: Sending signal '9' to world 1234
Your VM should now be off.
Link : VMware Forum