Sunday, 10 January 2016

Unable To Power On A Virtual Machine: The operation is not allowed in the current connection state of the host

Written by Suhas Savkoor

So I spent a good 30 minutes on a Saturday, on call with AMD as their virtual machine would just not power on. It kept throwing the below error:

Also, you might experience one ore more of the below issues while trying to troubleshoot this virtual machine:
  • You are unable to remove this virtual machine from inventory.
  • You are unable to vMotion this virtual machine.
  • When you login to the host directly via vSphere client and Right click this virtual machine, most of the options are grayed out. Power ON is not available for this virtual machine. 
  • The virtual machine does not list when you run 
# vim-cmd vmsvc/getallvms

What can be done to resolve this:

1. Restart the VMware Virtual Center Server service and then try powering ON the virtual machine. 
2. Login to the SSH of the host and restart the management agents using the below command
# restart
Once the management agents are restarted, the virtual machine might enter into an orphaned state.

3. Right click the virtual machine and remove it from the inventory. This operation will succeed this time.
4. Browse the datastore where this virtual machine is residing and open the virtual machine folder.
5. Right click the virtual machine's .vmx file and add it to the inventory. Select the host/resource pool that is required.
6. Power on the virtual machine and this time the operation should succeed.