Stretching vSAN cluster via SDDC Manager API fails with "PUBLIC_INTERNAL_SERVER_ERROR"
search cancel

Stretching vSAN cluster via SDDC Manager API fails with "PUBLIC_INTERNAL_SERVER_ERROR"

book

Article ID: 437288

calendar_today

Updated On:

Products

VMware SDDC Manager / VCF Installer VMware Cloud Foundation

Issue/Introduction

  • When attempting to stretch a vSAN cluster using the SDDC Manager API Developer Center (PATCH /v1/clusters/{id}), the operation fails with a generic internal server error.
    "errorCode":  "PUBLIC_INTERNAL_SERVER_ERROR",
    "message":  "InternalServerError",
    "referenceToken": "######"
  • Log entries in /var/log/vmware/vcf/domainmanager/domainmanager.log: 

     INFO  [vcf_dm] [c.v.v.c.c.v.NetworkSpecValidator]  The uplink profile associated with the CVDS [HOSTNAME] is {"vdsName":"[HOSTNAME]","uplinkProfileName":"<name_of_uplink_profile>","ipAddressPoolName":"<name_of_address_pool",...}
     ERROR [vcf_dm] [c.v.v.c.c.v1.ClusterController] Failed to update cluster
    java.util.NoSuchElementException: No value present
            at java.base/java.util.Optional.get(Optional.java:143)
            at com.vmware.vcf.clustermanager.controller.validation.NetworkSpecValidator.getUplinkProfileForVds(NetworkSpecValidator.java:1194)
            at com.vmware.vcf.clustermanager.controller.validation.NetworkSpecValidator.getStretchClusterUplinkProfileForVds(NetworkSpecValidator.java:1169)

    The logs show a java.util.NoSuchElementException during the network validation phase.

Environment

VMware SDDC Manager

Cause

The issue is caused by a typographical error in the JSON payload used for the cluster stretch operation. The validation logic (NetworkSpecValidator) attempts to link the host switch configuration to its definition in the NSX cluster spec by name. If the uplinkProfileName in the host switch configuration does not exactly match the name defined in the uplinkProfiles array, the lookup fails, resulting in a NoSuchElementException

Resolution

To resolve this issue, align the uplink profile names in the JSON payload:

  1. Review the JSON payload provided in the PATCH /v1/clusters/{id} request.
  2. Locate the "uplinkProfileName" string within the nsxtHostSwitchConfigs section.
  3. Locate the name string within the nsxClusterSpec.uplinkProfiles section.
  4. Correct any typographical errors so that the names match exactly.
  5. Use the below endpoint to validate the corrected JSON before re-attempting the stretch operation.
     POST /v1/clusters/validation 

Once the configuration is aligned and typographical errors are corrected, the network validation phase will complete successfully, allowing the vSAN cluster stretch operation to proceed without further internal server errors.