How to Power off Unresponsive Virtual Machine on VMware ESXi 4.1

In the situation you are experiencing a virtual machine is unresponsive and cannot be stopped or cannot be powered off gracefully using the using the vSphere Client on VMware ESXi 4.1, you should proceed to use command line option to kill it. Please note that forcibly powering off a virtual machine might result in guest operating system data loss and it is similar to pulling the power cable on a physical machine. You can forcibly power off only a virtual machine is confirmed unresponsive. Follow below steps to power off unresponsive virtual machine from the command line:

1. List the inventory ID of the virtual machine :

vim-cmd vmsvc/getallvms

Example :

~ # vim-cmd vmsvc/getallvms
Vmid         Name                                  File                                 Guest OS         Version                            Annotation       
112    CentOS6.5           [datastore1] CentOS6.5/CentOS6.5.vmx                   other26xLinux64Guest   vmx-07    CentOS 6.5
304    win2k8              [datastore1] win2k8/win2k8.vmx                         winLonghorn64Guest     vmx-07

2. Assumed that the win2k8 or VMID 304 unresponsive, kindly verify the power state of the unresponsive virtual machine :

vim-cmd vmsvc/power.getstate VMID

Example :

~ # vim-cmd vmsvc/power.getstate 304

3. Try to use soft shutdown which is the normal shutdown :

~ # vim-cmd vmsvc/power.shutdown 304

4. If soft shutdown is not working, use force shutdown :

~ # vim-cmd vmsvc/power.off 304

5. If all proceeding above are not working, kindly proceed to kill the process ID :

Determine if the virtual machine process ID :

~ # ps | grep win2k8
39993      vmm0:win2k8
39995 39992 mks:win2k8           /bin/vmx
39996 39992 vcpu-0:win2k8        /bin/vmx
40043 39992 Worker#0:win2k8      /bin/vmx

Identify the parent vmx process for the unresponsive virtual machine. The first column contains the PID, and the second contains the parent’s PID. Ensure you terminate only the parent process. In this case we should kill 39992.

Terminate the process using this command:

kill ProcessID

Example :

~ # kill 39992

Wait 30 seconds and repeat step 2 to check for the process again. If it is not terminated, run this command:

kill -9 ProcessID

Example :

~ # kill -9 39992

Wait 30 seconds and check for the process again. Thats all.

Leave a Reply