Host Removal Task from SDDC Manager UI Fails with the error "Validate Sufficient ESXi Hosts Remain in vSphere Cluster"
search cancel

Host Removal Task from SDDC Manager UI Fails with the error "Validate Sufficient ESXi Hosts Remain in vSphere Cluster"

book

Article ID: 426658

calendar_today

Updated On:

Products

VMware SDDC Manager

Issue/Introduction

When attempting to remove or decommission one or more ESXi hosts from a cluster via the SDDC Manager UI, the task fails during the validation phase with the following error : "Validate Sufficient ESXi Hosts Remain in vSphere Cluster".

Message : "Hosts count after removal is -2 below the threshold, with force flag set to true"

 

Environment

VCF 5.x

Cause

1. This issue occurs because the SDDC Manager pre-check identifies that the resulting host count will violate the minimum requirements for critical cluster services.

2. This is by design.

Resolution

To resolve this issue, implement the host removal operation using Public API rather that using the UI and ensure the "forceByPassingSafeMinSize" parameter value is set to "true". Following steps need to be performed to achieve this:

  • Get the cluster ID for the cluster on which the host needs to be removed. Use the following API and make a note of the cluster ID.
    GET /v1/clusters

  • Get the host ID for the host needs to be removed. Use the following API using the cluster ID found in above step. Make a note of the Host ID.
    GET /v1/hosts

  • Use the following API to remove the host. Ensure correct cluster ID is entered the Cluster ID in the required field.
    PATCH /v1/clusters/{id}

         Use the following "CompactionSpec" information in the body. Enter the Host ID in the CompactionSpec information.

        {

          "clusterCompactionSpec": {
            "forceByPassingSafeMinSize": true,
            "hosts": [
              {
                "id": "##########################"
              }
            ]
          }
        }

 

         Refer to the following snippet for a detailed view. 

         

  • Once above API is executed successfully, ESXi hosts will be removed from the active configuration and will be moved to unassigned hosts.
  • The ESXi host then can be decommissioned from unassigned hosts.