Power On and Power Off VMs in ESXi 5.5 from the command line

Hello all! Quickie today because of something I just did that I thought was useful and I want to write .. mostly so I can remember how to do it! And share

How to power off and power on your VMs from the command line in ESXi. Why? This question came up from a friend/colleague who used vsphere client on a VM in ESXi. Normally he managed the VMs from vsphere client on this VM which wasn’t powering up. uh oh…

Power on VMs from the command line

The quickie version…

(well there is no long version)

Get a list of your VMs
vim-cmd vmsvc/getallvms

Find the one you’re interested in and check its “power” state
vim-cmd vmsvc/power.getstate [vmid]

Power off
vim-cmd vmsvc/power.off [vmid]

Power on
vim-cmd vmsvc/power.on [vmid]

A sample session screen-shotted for your pleasure:

README_vmware2

For more details including usage on other versions of ESXi, here are some references:

Have a great day!

, , Geek, VMware

Leave a Comment

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

Spam protection by WP Captcha-Free