Written by Suhas Savkoor
When you try to Power OFF a virtual machine, you might receive the following error:
Method 1:
Powering OFF the virtual machine from the command line:
From the SSH of the host where this VM resides:
1. Get the VM ID by running the below command:
# vim-cmd vmsvc/getallvms | grep -i <VM_Name>
#vim-cmd vmsvc/power.shutdown <VM_ID>
#vim-cmd vmsvc/power.off <VM_ID>
Method 2:
Kill the VM process:
1. Run the command:
ps | grep vmx
4324194 4324194 vmx /bin/vmx
4324200 4324194 vmx-vthread-5:Windows 2008 /bin/vmx
4324201 4324194 vmx-vthread-6:Windows 2008 /bin/vmx
4324202 4324194 vmx-mks:Windows 2008 /bin/vmx
4324203 4324194 vmx-svga:Windows 2008 /bin/vmx
4324204 4324194 vmx-vcpu-0:Windows 2008 /bin/vmx
4324205 4324194 vmx-vcpu-1:Windows 2008 /bin/vmx
The first column contains the Process ID, and second column is Parent Process ID. We need to Kill the parent Process ID. In this example, the Parent Process ID is 4324194.
2. Run the command to kill the process
# kill <process_ID>
# kill -9 <process_ID>
"-9" is a signal Kill, which sends a sigkill signal to the process that is specified.
Now, all these "kill" command might fail with a message,
"No such process found"Unable to kill Virtual Machine. Error was : Unable to kill virtual machine. Error returned was No such process"
In this case, the only solution to kill this stale process is to Reboot the host having this virtual machine, and this should let us Power OFF the virtual machine.
0 comments:
Post a Comment