Adding a host to expand a Stretched Cluster in VMware Cloud Foundation 9.0
search cancel

Adding a host to expand a Stretched Cluster in VMware Cloud Foundation 9.0

book

Article ID: 415557

calendar_today

Updated On:

Products

VMware SDDC Manager

Issue/Introduction

  • Expanding a stretched cluster is not supported through the GUI or the SDDC Manager interface. The process must be completed using API calls
  • This article describes how to add a host and expand a stretched cluster in VMware Cloud Foundation 9.0

Environment

VMware Cloud Foundation 9.0

Resolution

Procedure to add a host to a stretched cluster in VMware Cloud Foundation 9.0:

  1. Commission the new host:  Add the new ESXi host to the global inventory in SDDC Manager
    Reference: Commission ESX Hosts

  2. Retrieve the host UID of the host that is to be added to the stretched cluster
    1. In the SDDC Manager UI, navigate to Developer Center > API Explorer > hosts and click on GET /v1/hosts.

    2. Enter the FQDN of the host that is to be added to the cluster in the fqdn section.
    3. Click EXECUTE and then download the JSON output, or click on COPY RESPONSE to copy the contents to the clipboard.

    4. Open the JSON contents and copy the UID of the newly commissioned host.

      {
          "elements": [
              {
                  "id": "########-####-####-####-############",        <======= The ID of the host to be added in the stretched cluster
                  "serialNumber": null,
                  "esxiVersion": "9.0.0.0.XXXXXXXX",
                  "sshThumbprint": null,
                  "sslThumbprint": null,
                  "fqdn": "Host_FQDN",
                  "hardwareVendor": "VMware, Inc.",
                  "hardwareModel": "######",
                  "isPrimary": false,
                  "ipAddresses": [
                      {
                          "ipAddress": "IP_ADDRESS",
                          "type": "#####"
                      },
                      {
                          "ipAddress": "IP_ADDRESS",
                          "type": "######"
                      }
                  ],

       

  3. Obtain the cluster ID of the target cluster designated for the host addition
    1. Navigate to Developer Center > API Explorer > hosts  and click on GET /v1/clusters.

    2. Click EXECUTE and then download the JSON output, or click on COPY RESPONSE to copy the contents to the clipboard.

    3. Access the file contents and note down the cluster ID of the stretched cluster you want to expand. 
      Do note that the contents of the file would have information about both the workload and the management cluster. Note down the cluster ID of the cluster that is to be expanded.

      {
          "elements": [
              {
                  "id": "########-####-####-####-############",         <===Cluster id of the management cluster
                  "domain": {
                      "id": "########-####-####-####-############"
                  },
                  "name": "Management_cluster_name",
                  "status": "ACTIVE",
                  "primaryDatastoreName": "DATASTORE_NAME",
                  .
                  .
                  .
                  .
              },
              {
                  "id": "########-####-####-####-############",         <==Cluster id of the workload cluster
                  "domain": {
                      "id": "########-####-####-####-############"
                  },
                  "name": "WORKLOAD_CLUSTER_NAME",
                  "status": "ACTIVE",
                  "primaryDatastoreName": "DATASTORE_NAME",
                  .
                  .
                  .
                  .
              }
          ]
      }

       

  4. Identify the vSAN Fault Domain availability zone name
    1. Log in to the vCenter Server for your management domain at https://<vcenter-fqdn>/ui.

    2. Navigate to the stretched cluster (to be expanded) in the vCenter GUI and click on the Configure tab.
      vCenter UI> stretched cluster (to be expanded) > Configure

    3. Under vSAN > Fault Domains, note the availability zone name (primary or secondary) where this new host will be added.

    4. Ensure the necessary host groups are added to the cluster. The following KB article can be referenced for the standard conventions of a stretched cluster:
      Adding host to stretched cluster in SDDC fails with error "ADD_HOST_TO_HOST_GROUP_POST_VALIDATE_FAILED"

  5. Prepare the JSON Request Body for adding the host to the stretched cluster
    1. Navigate to Developer Center > API Explorer > hosts  and click on PATCH /v1/clusters/{id}.

    2. Under ClusterUpdateSpec, click ClusterExpansionSpec{ ... } and download/copy to clipboard the example JSON.

    3. Edit the JSON file so that it includes only the clusterExpansionSpec section for the host.

    4. In the azName field, specify the availability zone name identified in Step 4.

    5. Ensure that the new host uses the same vmnic-to-vSphere Distributed Switch mapping as the existing hosts in the stretched cluster.

      vCenter UI -> Host -> Configure -> Virtual Switches.
      Note down the uplinks assigned to the vSphere Distributed Switch

      {
          "clusterExpansionSpec": {
              "deployWithoutLicenseKeys": true,
              "hostSpecs": [
                  {
                      "id": "Enter the ESXi host id",
                      "azName": "Enter the primary/secondary fault domain name where the host will be added",
                      "hostNetworkSpec": {
                          "vmNics": [
                              {
                                  "id": "vmnic#",
                                  "vdsName": "Enter the vDS name"
                              },
                              {
                                  "id": "vmnic#",
                                  "vdsName": "Enter the vDS name"
                              }
                          ]
                      }
                  }
              ]
          }
      }
      }

      Depending on the number of uplinks, modify the above snippet accordingly. The above snippet would be applicable for a host with two uplinks in the vDS.

  6. Run the Expand Cluster API

    1. Navigate to Developer Center > API Explorer > hosts  and click on PATCH /v1/clusters/{id}.
    2. Replace {id} with the cluster ID retrieved in Step 3.

    3. Paste the modified JSON payload from Step 5 into the request body.

    4. Click Execute to begin the cluster expansion.

    5. Monitor the API response or SDDC Manager tasks until the operation completes successfully.

Additional Information