Error: "Invalid parameter: Hosts collection cannot be empty" during cluster deletion in SDDC Manager
search cancel

Error: "Invalid parameter: Hosts collection cannot be empty" during cluster deletion in SDDC Manager

book

Article ID: 439787

calendar_today

Updated On:

Products

VMware SDDC Manager / VCF Installer

Issue/Introduction

Attempts to delete a cluster from the SDDC Manager UI fails when the cluster reaches an "empty" state (no associated hosts or networks) due to out-of-band modifications or incomplete inventory sync.

Symptoms:

  • The "Disconnect ESXi Host" task during cluster deletion operation fails in the SDDC Manager UI with the error message: Invalid parameter: Hosts collection cannot be empty.

  • The /var/log/vmware/vcf/domainmanager/domainmanager.log file in SDDC Manager contains the following entry:

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 0VCF_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

  • Inspection of SDDC Manager platform database shows the cluster in an ERROR or DEACTIVATING state with a blank source_id when executing the following command:

    • In SDDC Manager version 9.1: psql -h localhost -U postgres -d platform -c "select id,status,source_id from cluster;"

    • In SDDC Manager version 9.0.x and below: psql -h localhost -U postgres -d platform -c "select id,name,status,source_id from cluster;"

Environment

  • SDDC Manager 5.2.x

  • SDDC Manager 9.x

Cause

SDDC Manager workflows require at least one host reference to initialize the cluster deletion task. If hosts are manually removed from vCenter or the database, the orchestrator cannot process the deletion.

Resolution

Note: Prior to making any modifications, take a snapshot of the SDDC Manager appliance. For detailed instructions, see Taking and restoring snapshots of the SDDC Manager appliance

Follow these steps to force delete the cluster via the API. API force-delete can only be initiated after a standard deletion attempt through the SDDC Manager user interface has failed.

  1. Ensure the cluster state is set to ACTIVE:

    1. Connect to the SDDC Manager appliance using an SSH client as the vcf user, then switch to root using the su command.

    2. List the cluster which is in ERROR state in SDDC Manager platform database: psql -h localhost -U postgres -d platform -c "\x" -c "select * from cluster where status='ERROR';"

    3. Mark the cluster as ACTIVE: psql -h localhost -U postgres -d platform -c "update cluster set status='ACTIVE' where id='<cluster id from the above step>';"

  2. If the cluster is not in an ERROR state, the cluster ID can alternatively be retrieved via an API call: GET /v1/clusters.

  3. Execute a DELETE request to force the removal: DELETE /v1/clusters/{id}?force=true.

  4. Monitor the deletion progress via the tasks view in the SDDC Manager UI.

  5. If the API force-delete fails due to underlying database inconsistencies, manual cleanup of the SDDC Manager database is required. As the direct SQL deletions carry a risk of inventory corruption, Contact Broadcom Support for guided assistance with the manual SQL cleanup procedures.