How to force kill a VM and start it from the CLI in ESXi

Find the World ID of the VM

esxcli vm process list | grep -C5 $VMNAME

Force kill it

esxcli vm process kill --type force --world-id $WORLDID

Find the VMID

vim-cmd vmsvc/getallvms | grep $VMNAME

Power on

vim-cmd vmsvc/power.on $VMID

Check the power state of the VM

vim-cmd vmsvc/power.getstate $VMID
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s