To Power on and off Virtual Machines in the ESXi Command Line use the commands below :
To get the current state of all virtual machines on a host
vim-cmd vmsvc/getallvmsTo list the current power state of a Virtual Machine use the ID from above.
vim-cmd vmsvc/power.getstate VMIDShutdown a virtual machine
vim-cmd vmsvc/power.shutdown VMIDIf the virtual machine fails to shut down, use this command:
vim-cmd vmsvc/power.off VMIDTo turn on a Virtual machine use the code
vim-cmd vmsvc/power.on VMID
Comments