Removing cluster from SDDC Manager fails with: "Invalid parameter: Hosts collection cannot be empty."
search cancel

Removing cluster from SDDC Manager fails with: "Invalid parameter: Hosts collection cannot be empty."

book

Article ID: 439787

calendar_today

Updated On:

Products

VMware SDDC Manager

Issue/Introduction

  • When attempting to delete a cluster from the SDDC Manager UI or API, the "Disconnect ESXi Host" task fails with the following error:

    Invalid parameter: Hosts collection cannot be empty. 

  • In /var/log/vmware/vcf/domainmanager/domainmanager.log, below entries can be found indicating that the host collection is null or empty during the disconnect task:

    Contract task Disconnect ESXi Host input: {"vcRemoteEndpoint":{"address":"<vcenter FQDN>","port":0,"username":"<user account>","password":"*****"},"hostnames":[],"continueOnFailure":false,"_executeRetrialCount":0,"_preValidationRetrialCount":0,"_maxRetriesCount":3}
    Tracking ContinueOnFailure false flag, Max Retry Count 3  and pre Validate Retry Count 0
    VCF_ERRORS_GENERIC_INPUT_PARAM_ERROR Invalid parameter: Hosts collection cannot be empty com.vmware.evo.sddc.orchestrator.exceptions.OrchTaskException: Invalid parameter: Hosts collection cannot be empty

  • The cluster to delete is an empty cluster. The hosts were removed from database directly or in other way instead of using the standard workflow. 

Environment

SDDC manager 5.2.x

Cause

This issue typically occurs when the cluster is already empty. SDDC Manager's standard workflow is designed to prevent clusters from reaching an "empty" state. If hosts were manually removed from the inventory (e.g., via direct database manipulation or external vCenter actions) instead of using the SDDC Manager workflow, the standard "Delete Cluster" workflow fails.

Resolution

To remove an orphaned or empty cluster that cannot be deleted via the standard GUI workflow, use the Force Delete option via the SDDC Manager API.

Steps:

  1. Obtain the Cluster ID from the SDDC Manager UI or via the GET /v1/clusters API call.
  2. Perform a DELETE request to the following endpoint:

    DELETE /v1/clusters/{id}?force=true

  3. Monitor the task in the SDDC Manager Tasks view