By using the VMware Cloud Foundation API, you can deploy an example workload domain with 4 physical NICs per hosts, distributing the NICs between multiple vSphere Distributed Switch instances.

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

Table 1. Example Workload Domain Specification

Component

Value

SDDC Manager FQDN

sddc-manager.vrack.vsphere.local

vCenter Server FQDN

vcenter-2.vrack.vsphere.local

Number of hosts

3

Cluster name

Cluster1

Number of physical NICs per host

4

vSphere Distributed Switch instances

  • SDDC-Dswitch-Private1

  • SDDC-Dswitch-Private2

vmnic per vSphere Distributed Switch configuration

  • vmnic0, vmnic 1 - SDDC-Dswitch-Private1

  • vmnic2, vmnic 3 - SDDC-Dswitch-Private2

Distributed port groups

  • SDDC-Dswitch-Private1

    • SDDC-DPortGroup-Mgmt

    • SDDC-DPortGroup-vMotion

    • SDDC-DPortGroup-VSAN

  • SDDC-Dswitch-Private2

    • SDDC-DPortGroup-Public

NIC teaming policy

Route based on physical NIC load (default)

vSphere Distributed Switch for VXLAN

SDDC-Dswitch-Private1

NSX Manager FQDN

nsx-2.vrack.vsphere.local

NSX Controller IP addresses

  • 10.0.0.45

  • 10.0.0.46

  • 10.0.0.47

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 domain from the id field.
  4. Prepare a domain 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

    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
    
    {
      "domainName": "myWLD01",  
      "vcenterSpec": {  
        "name": "vcenter-2",  
        "networkDetailsSpec": {  
           "ipAddress": "10.0.0.43",  
           "dnsName": "vcenter-2.vrack.vsphere.local",  
           "gateway": "10.0.0.250",  
           "subnetMask": "255.255.255.0"
         },  
         "rootPassword": "Random0$",  
         "datacenterName": "new-vi-1"  
       },  
       "computeSpec": {  
          "clusterSpecs": [ {  
              "name": "Cluster1",  
              "hostSpecs": [ {  
                  "id": "97fea1a1-107e-4845-bdd1-6a14ab18010a",
                  "license":"AAAAA-AAAAA-AAAAA-AAAAA-AAAAA",
                  "hostNetworkSpec": {  
                     "vmNics": [ {  
                         "id": "vmnic0",  
                         "vdsName": "SDDC-Dswitch-Private1"  
                      }, {  
                         "id": "vmnic1",  
                         "vdsName": "SDDC-Dswitch-Private1"  
                      }, { 
                         "id": "vmnic2",  
                         "vdsName": "SDDC-Dswitch-Private2" 
                      }, {  
                         "id": "vmnic3",  
                         "vdsName": "SDDC-Dswitch-Private2"  
                      } ]  
                   }  
                }, {  
                  "id": "b858eb07-4f07-4e34-8053-d502bf9cfeb0",
                  "license":"AAAAA-AAAAA-AAAAA-AAAAA-AAAAA",
                  "hostNetworkSpec": {  
                     "vmNics": [ {  
                         "id": "vmnic0",  
                         "vdsName": "SDDC-Dswitch-Private1"  
                      }, {  
                         "id": "vmnic1",  
                         "vdsName": "SDDC-Dswitch-Private1"  
                      }, { 
                         "id": "vmnic2",  
                         "vdsName": "SDDC-Dswitch-Private2" 
                      }, {  
                         "id": "vmnic3",  
                         "vdsName": "SDDC-Dswitch-Private2"  
                      } ]  
                   }  
                }, {  
                  "id": "45c3c5e6-6c49-46d2-a027-216d2a20c8d1",
                  "license":"AAAAA-AAAAA-AAAAA-AAAAA-AAAAA",
                  "hostNetworkSpec": {  
                     "vmNics": [ {  
                         "id": "vmnic0",  
                         "vdsName": "SDDC-Dswitch-Private1"  
                      }, {  
                         "id": "vmnic1",  
                         "vdsName": "SDDC-Dswitch-Private1"  
                      }, { 
                         "id": "vmnic2",  
                         "vdsName": "SDDC-Dswitch-Private2" 
                      }, {  
                         "id": "vmnic3",  
                         "vdsName": "SDDC-Dswitch-Private2"  
                      } ] 
                   } 
               } ],     
        "datastoreSpec": {  
            "vsanDatastoreSpec": {  
                "failuresToTolerate": 1,  
                "licenseKey": "BBBBB-BBBBB-BBBBB-BBBBB-BBBBB",
                "datastoreName": "vSanDatastore" 
             }  
         },  
         "networkSpec": { 
             "vdsSpecs": [ { 
                 "name": "SDDC-Dswitch-Private1", 
                 "portGroupSpecs": [ {  
                     "name": "SDDC-DPortGroup-Mgmt", 
                     "transportType": "MANAGEMENT" 
                 }, { 
                     "name": "SDDC-DPortGroup-VSAN",  
                     "transportType": "VSAN" 
                 }, {  
                     "name": "SDDC-DPortGroup-vMotion", 
                     "transportType": "VMOTION" 
                 } ] 
              },  
              {  
                 "name": "SDDC-Dswitch-Private2", 
                 "portGroupSpecs": [ { 
                    "name": "SDDC-DPortGroup-Public", 
                    "transportType": "PUBLIC"  } ] 
               } 
            ],  
            "nsxClusterSpec": { 
               "nsxVClusterSpec": {  
                  "vlanId": 0,  
                  "vdsNameForVxlanConfig": "SDDC-Dswitch-Private1"  
                }  
              }  
            }  
          } ] 
       }, 
      "nsxVSpec": {  
         "nsxManagerSpec": {  
            "name": "nsx-2",  
            "networkDetailsSpec": { 
               "ipAddress": "10.0.0.44",  
               "dnsName": "nsx-2.vrack.vsphere.local",  
               "gateway": "10.0.0.250",
               "subnetMask": "255.255.255.0"
             }
          }, 
          "nsxVControllerSpec": {  
             "nsxControllerIps": [ "10.0.0.45", "10.0.0.46", "10.0.0.47"], 
             "nsxControllerPassword": "Test123456$%",
             "nsxControllerGateway": "10.0.0.250",
             "nsxControllerSubnetMask": "255.255.255.0"
          },  
         "licenseKey": "CCCCC-CCCCC-CCCCC-CCCCC-CCCCC",
         "nsxManagerAdminPassword": "Random0$",  
         "nsxManagerEnablePassword": "Random0$"
      }
    }
  5. By using the JSON specification, add the workload domain to VMware Cloud Foundation by sending this request.
    POST https://sddc-manager.vrack.vsphere.local/v1/domains HTTP/1.1
    Authorization: Basic admin REST API admin password
    Content-Type: application/json
  6. If the task fails, retry running it from the user interface of SDDC Manager.