Powering off/on a virtual machine on an ESXi host
- Angelo Schalley
- Aug, 22, 2012
- vmware
- No Comments
Log on to the ESXi console. Or via SSH
Get a list of all registered virtual machines, identified by their VMID, Display Name, and path to the .vmx configuration file, using this command:
vim-cmd vmsvc/getallvms
To get the current state of a virtual machine:
vim-cmd vmsvc/power.getstate VMID
Shutdown the virtual machine using the VMID found in Step 2 and run:
vim-cmd vmsvc/power.shutdown VMID
Note: If the virtual machine fails to shut down, use this command:
vim-cmd vmsvc/power.off VMID