How to Power on a virtual machine from the command line on VMware ESXi 4.1

Assumed that the esxi host cannot be managed from vCenter Server or from vSphere Client due to some reasons such as host not responding but you still can established putty session to that host. You still can power on the virtual machine using vim-cmd command. This steps has been tested on esxi 4.1 and require root access to the esxi host, either at the physical console or using SSH putty session. Follow below steps to power on a virtual machine from the command line:

1. List the inventory ID of the virtual machine :

vim-cmd vmsvc/getallvms

Example :

~ # vim-cmd vmsvc/getallvms
Vmid         Name                                  File                                 Guest OS         Version                            Annotation       
112    CentOS6.5           [datastore1] CentOS6.5/CentOS6.5.vmx                   other26xLinux64Guest   vmx-07    CentOS 6.5
96     CentOS6.5-LAMP      [datastore1] CentOS6.5-LAMP/CentOS6.5-LAMP.vmx         other26xLinux64Guest   vmx-07    CentOS 6.5

2. Check the power state of the virtual machine :

vim-cmd vmsvc/power.getstate VMID

Example :

~ # vim-cmd vmsvc/power.getstate 96
Retrieved runtime info
Powered off

3. Power-on the virtual machine :

vim-cmd vmsvc/power.on VMID

Example :

~ # vim-cmd vmsvc/power.on 96
Powering on VM:

Leave a Reply