Add a host to a cluster of hosts within a specific SDDC.
Prerequisites
- You must know the name of the cluster to which you want to add a host.
- If you want to add a host with NFS enabled, verify that the NFS mount is active.
- You must have the required privileges to perform this task.
Procedure
- ♦ Send the following POST request to the server. The session ID is sent in the header and the host specification is sent in the body of the request.
https://{{server_ip}}:9443/api/v1/sddc/{{sddc_id}}/cluster/{{cluster_name}}/hosts
curl --location --request POST "https://{{server_ip}}:9443/api/v1/sddc/1/cluster/MGMT_CLU/hosts" \ --header "Content-Type: application/json" \ --header "JSESSIONID: {{JSESSIONID}}" \ --data "{...}"
Results
{ "task_id": "2" }
Example: Body of the Request With and Without NFS
With NFS:
{ "hostSpec": { "username": "root", "password": "Skoda1!", "type": "SECONDARY", "vmknicSpecs": { "esxiMgmt": { "ipSpec": { "ip": "192.168.101.105", "subnet": "255.255.255.0", "fqdn": "esxmb5.cloud.vmw", "gw": "192.168.101.1" }, "type": "ESXi_MGMT", "name": "vmk0", "vlanId": 0 }, "vsan": { "ipSpec": { "ip": "192.168.102.105", "subnet": "255.255.255.0", "gw": "192.168.102.1" }, "type": "VSAN", "name": "vmk1", "vlanId": 0 }, "vmotion": { "ipSpec": { "ip": "192.168.103.105", "subnet": "255.255.255.0", "gw": "192.168.103.1" }, "type": "VMOTION_PG", "name": "vmk2", "vlanId": 0 }, "nfs": { "ipSpec": { "ip": "192.168.104.105", "subnet": "255.255.255.0", "gw": "192.168.104.1" }, "type": "NFS", "name": "vmk3", "vlanId": 0 } }, "pnicSpec": { "uplink1": { "name": "vmnic0" }, "uplink2": { "name": "vmnic1" } }, "vsanDiskSpec": { "autoDiskGroups": true, "diskGroups": [] } }, "nfsSpec": { "nfsDatastoreClusterName": "NFS_DS_CLU", "nfsDatastores": [ { "localPath": "NFS-1", "remoteIp": "192.168.101.11", "remoteMountPath": "/data/nfs1/", "accessMode": "readWrite" } ] } }
Without NFS:
{ "username": "root", "password": "Skoda1!", "type": "SECONDARY", "vmknicSpecs": { "esxiMgmt": { "ipSpec": { "ip": "192.168.101.105", "subnet": "255.255.255.0", "fqdn": "esxmb5.cloud.vmw", "gw": "192.168.101.1" }, "type": "ESXi_MGMT", "name": "vmk0", "vlanId": 0 }, "vsan": { "ipSpec": { "ip": "192.168.102.105", "subnet": "255.255.255.0", "gw": "192.168.102.1" }, "type": "VSAN", "name": "vmk1", "vlanId": 0 }, "vmotion": { "ipSpec": { "ip": "192.168.103.105", "subnet": "255.255.255.0", "gw": "192.168.103.1" }, "type": "VMOTION_PG", "name": "vmk2", "vlanId": 0 } }, "pnicSpec": { "uplink1": { "name": "vmnic0" }, "uplink2": { "name": "vmnic1" } }, "vsanDiskSpec": { "autoDiskGroups": true, "diskGroups": [] } }