Power on VMs from ESXi command line

Ran into some stupid issue today. Don’t know why but suddenly I lost the storage of my homelab and all VMs had frozen and eventually crashed. Since my vCenter is running as a VM, it had gone too and I couldn’t manage my hosts anymore. Therefore I wanted to make a direct connection to the host. Now, the hosts had recently be upgraded to 4.1 Update 1, but my vCenter wasn’t. Which meant that my vSphere Client was of an older version than the ESXi hosts and when trying to connect to the host, it wanted to download the new vSphere Client from vsphereclient.vmware.com. This wouldn’t be such a problem if it wasn’t that without Domain Controllers, there was no DNS either and the download failed.

I was left with SSH access to my hosts and was looking for good old vmware-cmd to restart my VMs. Hadn’t had the need for a long time to start VMs from the command line and didn’t know what the commands are in ESXi. For my own reference and maybe for some of my readers, here a list of the most important commands on the ESXi console:

List of the VMs registered on this host: vim-cmd vmsvc/getallvms
Power On a VM (get the ID from the previous command): vim-cmd vmsvc/power.on <ID>
Overview of many more commands: vim-cmd

After I checked the list of VMs, I could boot my domain controller, SQL Server and finally my vCenter server and was up and running soon after.

4 thoughts on “Power on VMs from ESXi command line

  1.  

    I came to your article from another article and am really interested in this learning about this. , 
    I feel strongly about information and love learning more on this. If possible, as you gain expertise, 
    It is extremely helpful for me. would you mind updating your blog with more information?

  2. found this out the hard panicky way at the weekend, if you’re using 3.5 the command is:

    VMware-vim-cmd vmsvc/power.on

Comments are closed.