If you get the error ‘The operation is not allowed in the current state’, try restarting the management agents on the hosts (non disruptive, other than you will lose vSphere client connectivity):
Restarting the Management agents on ESXi
To restart the management agents on ESXi:
From the Direct Console User Interface (DCUI):
- Connect to the console of your ESXi host.
- Press F2 to customize the system.
- Log in as root.
- Use the Up/Down arrows to navigate to Restart Management Agents.Note: In ESXi 4.1 and ESXi 5.0, 5.1, 5.5 and 6.0 this option is available under Troubleshooting Options.
- Press Enter.
- Press F11 to restart the services.
- When the service restarts, press Enter.
- Press Esc to log out of the system.
From the Local Console or SSH:
- Log in to SSH or Local console as root.
- Run these commands:/etc/init.d/hostd restart