Wednesday, February 3, 2010

How To KILL a stuck Virtual Machine (ESX 3.5)

Found this useful the other day - twice.

The first time a VM would not live migrate from one host to another. I stopped it and migrated but then it would not start, giving me the "Could not power on VM: No swap file. Failed to power on VM"
Using the below instruction I managed to kill the process that was still making it seem like the VM was running fine.

The second time I was taking a snapshot of a VM and it just did not work. Timed out AND made the VM freeze. I tried restarting and turning off the VM but it would not as there was "another process running" which I guess was the failed snapshot. Again, I used the below commands to kill the process (the VM) and was then able to start the VM.

ps -auxwww | grep -i

Find the PID and kill -9 pid


vm-support -x - to list vmids

vm-support -X to kill it