When attempting to delete an empty cluster from the vCenter inventory, the operation fails with the following error:
"The operation is not allowed in the current state."
This error persists even after standard preparation steps, such as verifying the cluster contains no hosts or virtual machines, performing manual host cleanup, and placing the cluster into vCLS Retreat Mode.
VMware vSphere 8.x
This issue generally occurs when the vCenter management services (specifically VPXD or the vSAN Health Service) enter an inconsistent state.
A stale task or a synchronization mismatch between the management services and the vCenter database can cause a hung lock to remain on the cluster object, preventing the deletion command from executing.
To clear the invalid state and release the lock on the cluster object, perform a restart of the vCenter management services.
Verify Tasks: Check the vSphere Client to ensure there are no active or stalled tasks running against the cluster. If any are found, attempt to cancel them.
SSH to vCenter: Open an SSH session to the vCenter Server Appliance (VCSA) and authenticate using the root credentials.
Restart Services: Run the following commands to restart the management services and force a state refresh:
service-control --restart --all
Delete Cluster: Wait a few minutes for all services to fully initialize, log back into the vSphere Client, and delete the empty cluster.
Impact: Restarting the vCenter services using the service-control --restart --all command will cause a brief, temporary disruption to the vSphere Client UI and management APIs. However, it will not impact the underlying ESXi hosts or disrupt running virtual machine workloads