This article provides information on stopping virtual machines in an ESXi environment.
Note: If you are attempting to troubleshoot the cause of an unresponsive virtual machine, it is usually preferable to collect performance metrics and then either suspend or crash the virtual machine to collect additional troubleshooting information.
For more information, see:
Symptoms:
Powering off the virtual machine using the vSphere Client/vSphere Web Client
Attempt to power off the virtual machine gracefully using the client:
Using the ESXi esxcli command to power off a virtual machine
The esxcli
command can be used locally or remotely to power off a virtual machine running on ESXi 5.x or later.
.vmx
configuration file by running this command:esxcli vm process list
esxcli vm process kill --type= [soft,hard,force] --world-id= WorldNumber
Using esxtop to kill a virtual machine
You can use the k
command in esxtop
to send a signal to, and kill, a running virtual machine process.
esxtop
utility by running this command:esxtop
LWID
).World to kill
prompt, type in the Leader World ID from step 7, and press Enter.Using the ESXi command-line utility vim-cmd to power off the virtual machine
On the ESXi console, enter Tech Support mode and log in as root.
.vmx
configuration file by running this command:vim-cmd vmsvc/getallvms
vim-cmd vmsvc/power.getstate VMID
vim-cmd vmsvc/power.shutdown VMID
vim-cmd vmsvc/power.off VMID
VMware Skyline Health Diagnostics for vSphere - FAQ
Powering off an unresponsive virtual machine on an ESXi host
Troubleshooting virtual machine power on task hangs
Failed to power on virtual machine
Sending signals on ESXi to power off the virtual machine
A virtual machine can be halted from the command line by sending signals to the process.
Warning: This procedure is potentially hazardous to the ESXi host. If you do not identify the appropriate process ID (PID) and kill the wrong process, it may have unexpected results. If you are not comfortable with the following procedure, file a support request with Broadcom Support and note this Knowledge Base article ID (320877) in the problem description. For more information, please visit https://support.broadcom.com
kill
command to send a signal to, and terminate, a running virtual machine process.ps | grep vmx
7662 7662 vmx /bin/vmx
7667 7662 vmx /bin/vmx
7668 7662 mks:VirtualMachineName /bin/vmx
7669 7662 vcpu-0:VirtualMachineName /bin/vmx
vmx
process. Identify the parent vmx
process for the target virtual machine. The first column contains the PID, and the second contains the parent's PID. Ensure you terminate only the parent process. The parent Process ID (PID) for each process is listed in the second column, identified in this example in bold. Take note of this number for use in the following steps.vmx
process is listed, terminate the process by running this command:kill ProcessID
kill -9 ProcessID
If a virtual machine cannot be powered off using any of these methods, it usually indicates a problem with the underlying infrastructure, such as the ESXi host or its backing hardware.
If a problem is suspected with the ESXi host that is preventing the shutdown of virtual machines, vMotion all unaffected virtual machines off the host, and force the host to halt with a purple diagnostic screen. For more information, see Using hardware NMI facilities to troubleshoot unresponsive hosts (1014767).