By using the VMware Cloud Foundation API, you can add an example host that has four physical NICs, distributing the NICs to a vSphere Distributed Switch and an N-VDS.
In this cluster example, a host is added to the second cluster of the example workload domain.
Table 1.
Example Workload Domain Host Specification
|
Component |
Value |
SDDC Manager FQDN |
sfo01m01sddc01.sfo01.rainpole.local |
Number of physical NICs per host |
4 |
Workload domain name |
sfo01-w01 |
vSphere Distributed Switch configuration |
vSphere Distributed Switch instance |
sfo01-w01-c02-vds01 |
vmnic configuration for vSphere Distributed Switch sfo01-w01-c02-vds02 |
vmnic0, vmnic1 |
N-VDS configuration |
N-VDS instance |
Auto-generated name |
vmnic configuration for N-VDS |
vmnic2, vmnic3 |
Procedure
- Send a query for unassigned hosts to SDDC Manager by using this request.
GET https://sfo01m01sddc01.sfo01.rainpole.local/v1/hosts?status=UNASSIGNED_USEABLE HTTP/1.1
Authorization:Basic admin rest_api_admin_password
- In the response, locate the fqdn parameter for the target hosts.
- Write down the GUID of the host object for the cluster from the id field.
- Send a query for clusters to SDDC Manager by sending this request.
GET https://sfo01m01sddc01.sfo01.rainpole.local/v1/clusters HTTP/1.1
Authorization:Basic admin rest_api_admin_password
- In the response, locate the name parameter for the target cluster.
- Write down the GUID from the id parameter.
- Prepare a host specification in JSON format according to the requirements of your environment and send it for validation to SDDC Manager.
The URL contains the cluster GUID from 6.
Most of the parameters are self-explanatory.
Parameter |
Value |
clusterUpdateSpec.clusterExpansionSpec.hostSpecs.hostNetworkSpec.id |
GUID from 3. |
clusterUpdateSpec.clusterExpansionSpec.hostSpecs.hostNetworkSpec.license |
ESXi license key |
clusterUpdateSpec.clusterExpansionSpec.hostSpecs.hostNetworkSpec.vmNics.id |
Physical NIC to use, for example, vmnic0. |
POST https://sfo01m01sddc01.sfo01.rainpole.local/v1/clusters/cluster_id1/validations/updates HTTP/1.1
Authorization: Basic admin rest_api_admin_password
Content-Type: application/json
{
"clusterUpdateSpec": {
"clusterExpansionSpec": {
"hostSpecs": [
{
"hostNetworkSpec": {
"vmNics": [
{
"id": "vmnic0",
"vdsName": "sfo01-w01-c02-vds01"
},
{
"id": "vmnic1",
"vdsName": "sfo01-w01-c02-vds01"
},
{
"id": "vmnic2",
"moveToNvds": true
},
{
"id": "vmnic3",
"moveToNvds": true
}
],
"id": "8fdb3f46-ef65-46d8-8be3-e9ab484f79ca",
"licensekey": "AAAAA-AAAAA-AAAAA-AAAAA-AAAAA"
}
}
]
}
}
}
- By using the JSON specification, add the host to the cluster by sending this request.
PATCH https://sfo01m01sddc01.sfo01.rainpole.local/v1/clusters/cluster_id HTTP/1.1
Authorization: Basic admin rest_api_admin_password
Content-Type: application/json
- If the task fails, retry running it from the user interface of SDDC Manager.