Deploy a VI Workload Domain Using the VMware Cloud Foundation API
If you want to create a VI workload domain with more than one vSphere Distributed
Switch (vDS) or use ESXi hosts with more than two pNICs, you must use the
VMware
Cloud Foundation
API.This procedure uses the
domainCreationSpec
to create a new VI workload domain using
the VMware
Cloud Foundation
API. It
focuses on two specific sections of the domainCreationSpec
that
allow you to create a VI workload domain with more than one vDS or use ESXi hosts
with more than two pNICS; hostSpecs
and
vdsSpecs
. You will need to modify these sections
and complete the other sections of the
domainCreationSpec
that
are required for your environment. See the VMware Cloud
Foundation API Reference Guide for details on all the sections of the
domainCreationSpec
. See an example of a complete
domainCreationSpec
at the end of this procedure.The examples in the following procedure are based on the following
scenario.
Modify the examples based on your
Two vSphere Distributed Switches |
|
Four pNICs |
|
pNIC to vDS mapping |
|
vDS to traffic type mapping |
|
VMware
Cloud Foundation
environment.- Get the IDs for the ESXi hosts that you want to add to the VI workload domain.
- In theSDDC Manager UI, click .
- Expand theAPIs for managing Hostssection, and clickGET /v1/hosts.
- EnterUNASSIGNED_USEABLEin the status text box and clickExecute.
- In the response, locate and copy the ID of each host you want to add to the VI workload domain.
- In a text editor, create a JSON specification for thehostSpecs. For example:
For each ESXi host, add a section that includes:"hostSpecs" : [ { "id" : "0ac30e66-7f65-4477-8331-80c3777c153c", "licenseKey": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "username" : "root", "hostNetworkSpec" : { "vmNics" : [ { "id" : "vmnic0", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic1", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic2", "vdsName" : "sfo-w01-cl01-vds02" }, { "id" : "vmnic3", "vdsName" : "sfo-w01-cl01-vds02" } ] } },- id
- licenseKey
- userName
- hostNetworkSpec
- In a text editor, create a JSON specification for thevdsSpecs. For example:"vdsSpecs": [ { "name": "sfo-w01-cl01-vds01", "portGroupSpecs": [ { "name": "sfo01-w01-cl01-vds01-pg-mgmt", "transportType": "MANAGEMENT" }, { "name": "sfo01-w01-cl01-vds01-pg-vmotion", "transportType": "VMOTION" } ] }, { "name": "sfo-w01-cl01-vds02", "portGroupSpecs": [ { "name": "sfo01-w01-cl01-vds02-pg-vsan", "transportType": "VSAN" } ], "isUsedByNsxt": true }Specify"isUsedByNsxt": truefor the vDS to use for host overlay traffic. If you have multiple vSphere Distributed Switches, only one of them can specify"isUsedByNsxt": true.
- In theSDDC Manager UI, click .
- Expand theAPIs for managing Domainssection, and clickPOST /v1/domains/validations.
- In theDescription/Data Typecolumn, clickDomainCreationSpec.
- Replace thehostSpecssection with the information from the hostSpecs JSON file.
- Replace thevdsSpecssection with the information from the vdsSpecs JSON file.
- Update or remove the other sections of thedomainCreationSpecas needed, based on the VI workload domain you are creating.See an example of a completedomainCreationSpecat the end of this procedure.
- ClickExecuteto validate thedomainCreationSpec.If validation succeeds, copy the domainCreationSpec content and proceed to the next step. If validation fails, check the errors in the response, update the domainCreationSpec, and validate it again.
- Expand theAPIs for managing Domainssection, and clickPOST /v1/domains.
- Paste the validated domainCreationSpec content and clickExecute.Use theTaskspanel in theSDDC Manager UIto monitor the VI workload domain creation.
Example of a complete
domainCreationSpec
{ "domainName" : "sfo-w01", "vcenterSpec" : { "name" : "sfo-w01-vc01", "networkDetailsSpec" : { "ipAddress" : "10.0.0.43", "dnsName" : "sfo-w01-vc01.vrack.vsphere.local", "gateway" : "10.0.0.250", "subnetMask" : "255.255.255.0" }, "rootPassword" : "<password>", "datacenterName" : "sfo-w01-dc01", "vmSize" : "medium", "storageSize" : "lstorage" }, "computeSpec" : { "clusterSpecs" : [ { "name" : "sfo-w01-cl01", "hostSpecs" : [ { "id" : "0ac30e66-7f65-4477-8331-80c3777c153c", "licenseKey": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "username" : "root", "hostNetworkSpec" : { "vmNics" : [ { "id" : "vmnic0", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic1", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic2", "vdsName" : "sfo-w01-cl01-vds02" }, { "id" : "vmnic3", "vdsName" : "sfo-w01-cl01-vds02" } ] } }, { "id" : "05d1a8df-773a-46bb-8838-dcb5bb3358ea", "licenseKey": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "username" : "root", "hostNetworkSpec" : { "vmNics" : [ { "id" : "vmnic0", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic1", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic2", "vdsName" : "sfo-w01-cl01-vds02" }, { "id" : "vmnic3", "vdsName" : "sfo-w01-cl01-vds02" } ] } }, { "id" : "2b8b770f-265d-4a63-b830-9c98038c81b2", "licenseKey": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "username" : "root", "hostNetworkSpec" : { "vmNics" : [ { "id" : "vmnic0", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic1", "vdsName" : "sfo-w01-cl01-vds01" }, { "id" : "vmnic2", "vdsName" : "sfo-w01-cl01-vds02" }, { "id" : "vmnic3", "vdsName" : "sfo-w01-cl01-vds02" } ] } } ], "datastoreSpec" : { "vsanDatastoreSpec" : { "failuresToTolerate" : 1, "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "datastoreName" : "sfo-w01-cl01-ds-vsan01" } }, "networkSpec" : { "vdsSpecs" : [ { "name" : "sfo-w01-cl01-vds01", "portGroupSpecs" : [ { "name" : "sfo-w01-cl01-vds01-pg-mgmt", "transportType" : "MANAGEMENT" }, { "name" : "sfo-w01-cl01-vds01-pg-vmotion", "transportType" : "VMOTION" }] }, { "name" : "sfo-w01-cl01-vds02", "portGroupSpecs" : [ { "name" : "sfo-w01-cl01-vds02-pg-vsan", "transportType" : "VSAN" } ], "isUsedByNsxt" : true } ], "nsxClusterSpec" : { "nsxTClusterSpec" : { "geneveVlanId" : 2, "ipAddressPoolSpec" : { "name" : "static-ip-pool-01", "subnets" : [ { "ipAddressPoolRanges" : [ { "start" : "10.0.11.50", "end" : "10.0.11.70" }, { "start" : "10.0.11.80", "end" : "10.0.11.150" } ], "cidr" : "10.0.11.0/24", "gateway" : "10.0.11.250" } ] } } } } } ] }, "nsxTSpec" : { "nsxManagerSpecs" : [ { "name" : "sfo-w01-nsx01a", "networkDetailsSpec" : { "ipAddress" : "10.0.0.44", "dnsName" : "sfo-w01-nsx01a.vrack.vsphere.local", "gateway" : "10.0.0.250", "subnetMask" : "255.255.255.0" } }, { "name" : "sfo-w01-nsx01b", "networkDetailsSpec" : { "ipAddress" : "10.0.0.45", "dnsName" : "sfo-w01-nsx01b.vrack.vsphere.local", "gateway" : "10.0.0.250", "subnetMask" : "255.255.255.0" } }, { "name" : "sfo-w01-nsx01c", "networkDetailsSpec" : { "ipAddress" : "10.0.0.46", "dnsName" : "sfo-w01-nsx01c.vrack.vsphere.local", "gateway" : "10.0.0.250", "subnetMask" : "255.255.255.0" } } ], "vip" : "10.0.0.166", "vipFqdn" : "sfo-w01-nsx01.vrack.vsphere.local", "licenseKey" : "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "nsxManagerAdminPassword" : "<password>", "formFactor" : "large" } }