How to – kill / power off a virtual machine using esxcli command

If you want to power off or kill a virtual machine running on an ESXi host you can do this using the following esxcli command:

  • connect a console to your ESXi host (eg. SSH or ESXi Shell)

To get a list of all VMs running on the host use this command:

esxcli vm process list

The list contains: World ID, Process ID, VMX Cartel ID, UUID, display name and the path to the vmx config file:

kill_vm

To kill / power off the virtual machine use the following command:

esxcli vm process kill -type=xxxx – world-id=yyyyy

for -type=xxxx use: soft, hard or force

for world-id=yyyy use the World ID listed in the command above (eg. World ID 39731 for the example VM “Cold”)

Some information about the three possible shutdown methods:

soft = prefer this if you want to shut down “softly”

hard = equal to an immediate shutdown

force = hard kill of the VM

 

You can use ESXTOP to kill a VM, too! Read more about this here: How to – kill a running virtual machine process with ESXTOP

 

3 Comments

  1. Talah Codina

    Perfect! Worked like a charm:-)

    You can also kill an unresponsive VM using esxtop or PowerCLI:

    For example, using PowerCLI:

    Stop-VM -kill vmname -Confirm:$false

    Extracted from: http://www.sysadmit.com/2015/01/vmware-esxi-kill-vm.html

  2. neil

    correct cmd =

    esxcli vm process kill –type=xxxx –world-id=yyyyy

  3. neil

    use double hypen before type and world-id

Leave a Comment

Your email address will not be published. Required fields are marked *