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.