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"
VCF 5.x
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.
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:
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.