Sometimes your VM gets stuck and you have no possibility to do graceful shutdown or power off through the vSphere client.
Saying it differently, the VM is stuck and the only way is to reboot the whole ESXi host, which you certainly don’t want to do.

But the unresponsive VM running there can be “killed” through the CLI, yes. This can be done several ways, but I’ll show you a way of doing it through SSH session

 

1. login via ssh to the server it’s on.

2.run ‘ps -c | grep -i vmx-vthread | grep -i VMNAME
You get output like this:

~ # ps -c | grep -i vmx-vthread | grep -i vmname

39995 39767 vmx-vthread-5:vmname – 93.170.78.66 /bin/vmx -s sched.group=host/user
-# product=2;name=VMware ESX;version=5.5.0;buildnumber=1623387;licensename=VMware ESX Server;licenseversion=5.0;
-@ duplex=3;msgs=ui /vmfs/volumes/52bbb887-739eec76-c75b-0025908321be/norvps/windows.vmx
39997 39767 vmx-vthread-6:norvps – 93.170.78.66 /bin/vmx -s sched.group=host/user –
# product=2;name=VMware ESX;version=5.5.0;buildnumber=1623387;licensename=VMware ESX Server;licenseversion=5.0;
-@ duplex=3;msgs=ui /vmfs/volumes/52bbb887-739eec76-c75b-0025908321be/norvps/windows.vmx

 

3. Go ahead and take the first number (PID) on that line and run:

kill -9 PID

example: kill -9 39995

 

4. A simpler way to do this whole process without even thinking is this:

ps -c | grep -i vmx-vthread | grep -i vmname | awk ‘{ print $1 }’ |xargs kill -9

 

5. Once this is done, you can go back to the vsphere client and power on the vm Or you can aslo kill the process by using esxtop command, then using the key ‘k’ with the LWID number of the particular vm. You can get the LWID number by pressing the key “f” the c after esxtop command. If this method don’t work, you can’t vmotion the VM elsewhere or any other option don’t work either, there might be a hardware problem with the host

 

 

9 thoughts on “Recover a Dead VM

  1. I used to be recommended this website via my cousin. I am now not sure whether or not this put up is written by means of him as nobody else recognize such distinctive about my difficulty. You’re amazing! Thank you!

  2. I do not even know the way I ended up right here,
    but I believed this publish used to be good. I do not recognise who you’re but definitely you are going to a famous
    blogger for those who are not already. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *