Unable to delete empty cluster from vCenter with error: "The operation is not allowed in the current state".
search cancel

Unable to delete empty cluster from vCenter with error: "The operation is not allowed in the current state".

book

Article ID: 435783

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

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.

Environment

VMware vSphere 8.x

 

Cause

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.

Resolution

To clear the invalid state and release the lock on the cluster object, perform a restart of the vCenter management services.

  1. 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.

  2. SSH to vCenter: Open an SSH session to the vCenter Server Appliance (VCSA) and authenticate using the root credentials.

  3. Restart Services: Run the following commands to restart the management services and force a state refresh:

    • service-control --restart --all

  4. Delete Cluster: Wait a few minutes for all services to fully initialize, log back into the vSphere Client, and delete the empty cluster.

Additional Information

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