VMware Cloud Foundation

Workload Domain Operations on VMware Cloud Foundation 4.0 on Dell-EMC VxRail using Public API – Part 2

Authors:

  • Madhav Achari (Systems Test)
  • Amitrajit Chatterjee (Staf II Solutions Architect)

VMware Cloud Foundation 4.0 on Dell EMC VxRail introduces support of workload domain deployment and operations utilizing the public API interface. In this multi-part blog series, we will provide guidance on how to use these new APIs to perform common deployments and operations. In Part 1 of the blog series, we covered the deployment of workload domains while Part 2 will cover various workload domain related operations.

Detailed API documentation is located at VMware {code} site. This can also be accessed from inside the SDDC Manager from the Developer Center.

Pre-requisites

Please complete VCF-VxRail management domain bring up and deployment of Workload Domain. The subsequent domain operations can be done via public api as detailed below.

Obtain Access token

The SDDC Manager APIs are secured using token-based authentication. As a first step before invocation of any API, an access token must be obtained. Invoking the Token API returns a token pair – access token and refresh token. To invoke an API, the access token must be passed in the Authorization header as a Bearer token.

SSH to the SDDC Manager vm or a Linux jump vm and execute the relevant curl commands

Refresh Access token

If the Access token expires, a Refresh token will need to be obtained. A refresh token can be used any number of times to obtain an access token until it has not expired or been revoked. To check if any API call is failing due to expired token, review the log file /var/log/vmware/vcf/domainmanager/domainmanager.log. Sample error message is given below.  Follow the API guidance to obtain the Refresh token.

Add Host to Cluster

First image the new host and add it to the relevant VxRail cluster per Dell-EMC VxRail procedures. Multiple hosts can be added in simultaneously to a specific cluster.

Get Cluster ID

Next SSH to the SDDC Manager vm and execute the following command in preparation of completing the add host procedure to the cluster.

Prepare Add Host ( Cluster Expansion ) Json

Create a json file with information related to the host being added in. It should match the number of hosts which were added to the VxRail cluster previously.

File Add_Host_API :

Validate the Input Json

Validate the input json file created above to ensure there are no issues.

Validation of Input Json completed successfully

Wait for the validation of the input json to complete.

Execute the Add Host (Cluster Expansion) Workflow

Once the validation completes successfully, execute the following command to kick off the add host workflow. Rerun the command to monitor the status of the tasks. It can also be monitored from the SDDC manager GUI.

Review the cluster details from the SDDC Manager to ensure the correct number of hosts show up.

Complete Succesful API Response is given below.

 

Add Secondary Cluster to WLD

Once a workload domain has been deployed with the primary cluster, a secondary cluster can be added in. First image the nodes and complete first run of the VxRail cluster with the existing Workload Domain vCenter. Then prepare a json file with the details of the cluster being imported. Sample json file is available below.

 

Validate the Input Json

Execute the following command to validate the input json file created above.

 

Get Validation Status

Execute the following command to get the current validation status of the input json file.

Execute Add Secondary Cluster Workflow

Get Add Secondary Cluster Workflow Status

The full output is given below

Remove Host from Cluster

Removing host(s) from VxRail cluster is a two step process – first it needs to be removed from the SDDC Manager and then from the VxRail cluster. The host will need to be re-imaged before it an be added back to a cluster.

Prepare Input Json

Prepare json file with the required host id. Sample json file is given below

Get Cluster ID

Get the cluster id for the cluster from which the host will be removed.

Perform Validation

Execute the Delete Host Workflow

Get Delete Host Workflow Status

Full output is given below

The workflow can also be monitored from the SDDC Manager GUI. Once the workflow completes, login to the VxRail plugin in the vCenter and remove the host from the cluster.

 

Password Rotate

Passwords for all the supported components can be rotated via API calls also. Password Management section in VMware Cloud Foundation Administration guide has more details.

Prepare Input Json

Create a json file containing details of components for which the password will be rotated. Sample json file is given below.

Execute the Rotate Password Workflow

Get the Rotate Password Workflow Status

The workflow can also be monitored from the SDDC Manager GUI

Update Password

Unlike password rotation, which generates a randomized password, you can provide a specific password for a specific component. More details are available in VMware Cloud Foundation Administration guide.

Prepare Input Json

Create a json file containing details of components for which the password will be rotated. Sample json file is given below.

Execute the Update Password Workflow

Get the Rotate Password Workflow Status

# curl -X GET -H ‘Content-Type: application/json’ -H ‘Authorization: Bearer <token id>’ ‘https://192.168.15.28/v1/tasks/86295164-da53-49e2-af76-bd787ca87483’ -d @update_password –insecure | json_pp

The workflow can also be monitored from the SDDC Manager

Troubleshooting

  • If there are any API related errors around input json passed with invalid input, review the log file at /var/log/vmware/vcf/domainmanager/domainmanager.log. Below is a sample error message for invalid input json. Once the input json file has been fixed, execute the same API call to revalidate the json file.

  • If there are any workflow related errors, review the log file at /var/log/vmware/vcf/domainmanager/domainmanager.log to determine the issue. Once the issue has been fixed, retry the task from API following this guidance.

This concludes all the steps required to perform additional worklod domain operations post deployment.