Shutdown ESXi host over SSH
2016-04-08
Shutdown ESXi host over SSH
- Connect ESXi host over SSH
- Get a list of running virtual machines, we will use the [World ID] later.
esxcli vm process list
- Power off the virtual machines one by one from the list
esxcli vm process kill --type=[soft, hard, force] --world-id=[World ID]
- Shutdown VMs and Power off ESXi Host
/sbin/shutdown.sh && /sbin/poweroff
[Alternative]Power off/on a virtual machine with command-line utilities
- List VMs
vim-cmd vmsvc/getallvms
- Get the power state of a VM
vim-cmd vmsvc/power.getstate <Vmid>
- Power on a virtual machine
vim-cmd vmsvc/power.off <Vmid>