Error: "Validate cluster primary datastore" check failed during host addition in SDDC Manager
search cancel

Error: "Validate cluster primary datastore" check failed during host addition in SDDC Manager

book

Article ID: 444862

calendar_today

Updated On:

Products

VMware SDDC Manager / VCF Installer

Issue/Introduction

Symptoms:

  • Attempts to add a redeployed ESX host to a vCenter cluster via SDDC Manager fail during the pre-validation phase.

  • The SDDC Manager UI explicitly reports the following error:
    • Validate cluster primary datastore check failed
    • Cluster primary datastore is not valid
    • Cannot invoke "String.equalsIgnoreCase(String)" because "clusterPrimaryDataStoreSourceId" is null

Environment

  • VMware Cloud Foundation (VCF) 9.0.x
  • VMware SDDC Manager 9.0.x

Cause

The SDDC Manager database is missing the Managed Object Reference ID (MoRef ID) for the cluster's primary datastore.

During the host addition validation workflow, SDDC Manager compares the host's connected datastores against the cluster's designated primary datastore recorded in the database. Because the primary_datastore_source_id column for the cluster is set to null, the Java string comparison function fails with a NullPointerException, aborting the workflow.

Resolution

  1. Take a non-memory snapshot of the SDDC Manager virtual machine.

  2. Retrieve Datastore MoRef ID:
    1. Log in to the vSphere Client and navigate to Inventory > Storage.
    2. Select the primary datastore attached to the target cluster.
    3. Locate the browser address bar URL. Copy the MoRef ID (the string starting with datastore located immediately after the semicolon).

  3. Verify Database State:
    1. SSH into the SDDC Manager appliance with vcf, elevate to root.
    2. Connect to the platform database: psql -h localhost -U postgres -d platform
    3. Run the following query to confirm the null value: select id, name, primary_datastore_name, primary_datastore_source_id from cluster;

  4. Update the Database:
    1. Execute the SQL update command (replacing [MoRef_ID] and [Cluster_ID] with the specific values retrieved in previous steps):
      update cluster set primary_datastore_source_id='[MoRef_ID]' where id='[Cluster_ID]';

  5. Restart Services: /opt/vmware/vcf/operationsmanager/scripts/cli/sddcmanager_restart_services.sh

  6. Once services are online, refresh the SDDC Manager UI and reinitiate the Add Host operation.