By using the VMware Cloud Foundation API, you can create an example cluster of hosts, each having four physical NICs. You can distribute these NICs to multiple vSphere Distributed Switch instances.

For traffic separation, two vSphere Distributed Switches handle the traffic in the example cluster - one for system traffic and overlay traffic and one for external traffic. You assign a pair of physical NICs to each switch.

Table 1. Example Workload Domain Cluster Specification

Component

Value

SDDC Manager FQDN

sddc-manager.vrack.vsphere.local

Number of hosts

3

Number of physical NICs per host

4

vSphere Distributed Switch instances

  • w01-c02-vds01

  • w01-c02-vds02

vmnic per vSphere Distributed Switch configuration

  • vmnic0, vmnic 1 - w01-c02-vds01

  • vmnic2, vmnic 3 - w01-c02-vds02

Distributed port groups

  • w01-c02-vds01

    • w01-c02-vds01-management

    • w01-c02-vds01-vmotion

    • w01-c02-vds01-vsan

  • w01-c02-vds02

    • w01-c02-vds01-ext

NIC teaming policy

Route based on physical NIC load (default one)

vSphere Distributed Switch for VXLAN

w01-c02-vds01

Storage type

vSAN

Procedure

  1. Send a query for unassigned hosts to SDDC Manager by using this request.
    GET https://sddc-manager.vrack.vsphere.local/v1/hosts?status=UNASSIGNED_USEABLE HTTP/1.1
    Authorization:Basic admin REST API admin password
  2. In the response, locate the fqdn parameter for the target hosts.
  3. Write down the GUID of each host object for the cluster from the id field.
  4. Send a query for workload domains to SDDC Manager by using this request.
    GET https://sddc-manager.vrack.vsphere.local/inventory/domains HTTP/1.1
    Authorization: Basic admin REST API admin password
  5. In the response, locate the name parameter for the target workload domain
  6. Write down the GUID of the workload domain from the id property.
  7. Prepare a cluster specification in JSON format according to the requirements of your environment and send it for validation to SDDC Manager.
    Most of the parameters are self-explanatory.

    Parameter

    Value

    domainId

    GUID from Step 6.

    computeSpec.clusterSpecs.hostSpecs.id

    GUIDs from Step 3.

    computeSpec.clusterSpecs.hostSpecs.hostNetworkSpec.vmNics.id

    Physical NIC to use, for example, vmnic0.

    POST https://sddc-manager.vrack.vsphere.local/v1/domains/validations/creations HTTP/1.1
    Authorization:Basic admin REST API admin password
    Content-Type:application/json
    {
      "nsxVClusterSpec": {
        "vdsNameForVxlanConfig": "w01-c02-vds02",
        "vlanId": 0
      },
      "hostSpecs": {
        "hostSystemSpec": [
          {
            "license": "AAAAA-AAAAA-AAAAA-AAAAA-AAAAA",
            "id": "c2398611-23cd-4b94-b2e3-9d84848b73cb",
            "vmnicToVdsNameMap": {
                 "vmnic0": "w01-c02-vds01",
                 "vmnic1": "w01-c02-vds01",
                 "vmnic2": "w01-c02-vds02",
                 "vmnic3": "w01-c02-vds02"
                }
          },
          {
            "license": "AAAAA-AAAAA-AAAAA-AAAAA-AAAAA",
            "id": "8dbe7dcb-f409-4ccd-984b-711e70e9e767",
            "vmnicToVdsNameMap": {
                 "vmnic0": "w01-c02-vds01",
                 "vmnic1": "w01-c02-vds01",
                 "vmnic2": "w01-c02-vds02",
                 "vmnic3": "w01-c02-vds02"
                }
          },
          {
            "license": "AAAAA-AAAAA-AAAAA-AAAAA-AAAAA",
            "id": "e9ba66e0-4670-4973-bdb1-bc05702ca91a",
            "vmnicToVdsNameMap": {
                 "vmnic0": "w01-c02-vds01",
                 "vmnic1": "w01-c02-vds01",
                 "vmnic2": "w01-c02-vds02",
                 "vmnic3": "w01-c02-vds02"
                }
          }
        ]
      },
      "clusterName": "c02",
      "highAvailabilitySpec": {
        "enabled": true
      },
      "domainId": "983840c1-fa13-4edd-b3cb-907a95c29652",
      "datastoreSpec": {
        "vsanDatastoreSpec": {
          "license": "BBBBB-BBBBB-BBBBB-BBBBB-BBBBB",
          "ftt": 1,
          "name": "w01-c02-vsan01"
        }
      },
      "vdsSpec": [
        {
          "name": "w01-c02-vds01",
          "portGroupSpec": [
            {
              "name": "w01-c02-vds01-management",
              "transportType": "MANAGEMENT"
            },
            {
              "name": "w01-c02-vds01-vmotion",
              "transportType": "VMOTION"
            },
            {
              "name": "w01-c02-vds01-vsan",
              "transportType": "VSAN"
            } 
          ] 
        },
        {
           "name": "w01-c02-vds02",
           "portGroupSpec": [
            {
              "name": "w01-c02-vds02-ext",
              "transportType": "PUBLIC"
            }
            ]
        }
      ]
    }
    
  8. By using the JSON specification, add the cluster to the workload domain in VMware Cloud Foundation by sending this request.
    POST https://sddc-manager.vrack.vsphere.local/v1/clusters HTTP/1.1
    Authorization: Basic admin REST API admin password
    Content-Type: application/json
  9. If the task fails, retry running it from the user interface of SDDC Manager.