This article explains how to stop a virtual machine in an ESXi environment.
Note: When attempting to troubleshoot the cause of an unresponsive virtual machine, it is usually a good idea to collect performance metrics and then suspend or crash the virtual machine to gather additional troubleshooting information.
For more information, see:
VMware vSphere ESXi 6.x
VMware vSphere ESXi 7.x
Caution: Follow the sections and steps in this article in order. Do not skip a section or step as each step may impact the virtual machine.
Powering off a virtual machine using the vSphere Client/vSphere Web Client
Attempt to power off the virtual machine gracefully using the client.
esxcli
can be used locally or remotely to power off virtual machines running on ESXi 5.x and later.
esxcli vm process list
esxcli vm process kill --type= [soft,hard,force] --world-id= WorldNumber
Kill a Virtual Machine using esxtop
esxtop
LWID
Identify the target virtual machine by its name and leader world ID ( ).World to kill
At the prompt, enter the Leader World ID from step 7 and press Enter.Powering off a virtual machine using the ESXi command line utility vim-cmd
.vmx
to get a list of all registered virtual machines, identified by their VMID, display name, and path to their configuration file:vim-cmd vmsvc/getallvms
vim-cmd vmsvc/power.getstate VMID
vim-cmd vmsvc/power.shutdown VMID
Note: If the virtual machine fails to shut down, run the following command:vim-cmd vmsvc/power.off VMID
Note: If the above steps do not resolve the issue and the ESXi host is responsive, it may be necessary to reboot and power off the virtual machines. To avoid downtime migrate all virtual machines using vMotion to another ESXi.
Send a signal to ESXi to power off the virtual machine
A virtual machine can be stopped from the command line by sending a signal to the process.
WARNING: This procedure can be dangerous for the ESXi host. Not identifying the correct process ID (PID) and killing the wrong process can lead to unexpected results. If the issue persists after performing these steps, file a support request with VMware Technical Support and note this Knowledge Base article ID (1014165) in the problem description. For more information, see Creating and managing Broadcom support cases
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
vmx
kill ProcessID
kill -9 ProcessID