When attempting to clone a virtual machine (VM) via PowerCLI or the vSphere Client, the operation fails with the following error:
"The operation is not allowed in the current state of the host."
This issue occurs despite the host appearing to be connected and active. The error is limited to cloning operations; other tasks such as Power On, vMotion, or Reconfigure continue to function normally.
VMware ESX 9.x
VMware vCenter 9.x
This issue is caused by a stale "vm-prov EMM latch" on the affected ESXi hosts. This latch is an in-memory flag in the vpxd service that wrongly indicates the host is still in (or entering) Maintenance Mode, even after the host has exited that state. This typically occurs if a previous Maintenance Mode task was interrupted or encountered an error.
To clear the stale data and restore cloning functionality, use one of the following methods.
Restarting the vpxd service forces vCenter to refresh the host status and clear stale latches.
shell.vpxd service:Note: The vSphere Client may take several minutes to reload and display the hosts as "Connected" after the service restarts.
If a vpxd restart is not feasible, performing a Maintenance Mode cycle on the affected hosts can also reset the latch.
After performing either of the above steps, attempt the clone operation again. It should now complete successfully.
vpxd) memory.vpxd service, as this will interrupt them.