Total Pageviews

My YouTube Channel

Monday, 18 January 2016

Forcibly Stopping Virtual Machines with EXCLI

In some cases, virtual machines do not respond to the normal shutdown or stop commands. In these cases, it might be necessary to forcibly shut down the virtual machines. Forcibly shutting down a virtual machine might result in guest operating system data loss and is similar to pulling the power cable on a physical machine.
 To forcibly stop a virtual machine
List all running virtual machines on the system to see the World ID of the virtual machine that you want to stop.
esxcli <conn_options> vm process list
Stop the virtual machine by running the following command.
esxcli <conn_options> vm process kill --type <kill_type> --world-id <ID>
The command supports three --type options. Try the types sequentially (soft before hard, hard before force). The following types are supported through the --type option:
soft. Gives the VMX process a chance to shut down cleanly (like kill or kill -SIGTERM)
hard. Stops the VMX process immediately (like kill -9 or kill -SIGKILL)
force. Stops the VMX process when other options do not work.
If all three options do not work, reboot your ESXi host to resolve the issue.

Source VMware Documentation