Adding a VMware Cloud on AWS cloud account with a proxy requires manual deployment of a cloud proxy VM. Then you make a POST request with a request body that includes the data collector ID along with parameters specific to VMware Cloud on AWS.

Prerequisites

  • Verify that all general prerequisites and prerequisites for the Cloud Assembly Infrastructure as a Service (IaaS) service have been satisfied. See Prerequisites for API Use Case Examples.
  • Verify that a cloud proxy VM has been manually deployed.
  • Verify that you have the following parameters for the new cloud account:
    • VMC API token.
    • SDDC name.
    • vCenter private IP.
    • NSX Manager IP.
    • vCenter user name.
    • vCenter password.
    • vCenter data center ID.

Procedure

  1. List all cloud proxies.
    curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/data-collectors?api_version=$api_version" | jq "."
  2. Examine the response and assign the data collector variable.
    data_collector_id='<your_datacollector_id>'
  3. Assign the account variables for the VMC cloud account.
    vmc_api_token='<your_vmc_api_token>' vmc_sddc_name='<your_vmc_sddc_name>' vmc_vcenter_private_ip='<your_vcenter_private_ip>' vmc_nsx_manager_ip='<your_nsx_manager_ip>' vmc_vcenter_username='<your_vcenter_username>' vmc_vcenter_password='<your_vcenter_password>' vmc_vcenter_datacenter_id='<your_datacenter_id>'
  4. Submit a request to create a VMC cloud account.
    curl -X POST \ "$url/iaas/api/cloud-accounts?apiVersion=$api_version" \ -H "Authorization: Bearer $access_token" \ -H 'Content-Type: application/json' \ -d '{ "name": "vmc-endpoint", "description": "VMC cloud account", "cloudAccountType": "vmc", "privateKeyId": "'"$vmc_vcenter_username"'", "privateKey": "'"$vmc_vcenter_password"'", "cloudAccountProperties": { "sddcId": "'"$vmc_sddc_name"'", "apiKey": "'"$vmc_api_token"'", "hostName": "'"$vmc_vcenter_private_ip"'", "nsxHostName": "'"$vmc_nsx_manager_ip"'", "dcId": "'"$vmc_data_collector_id"'", "acceptSelfSignedCertificate": "false" }, "regionIds": [ "'"$vmc_vcenter_datacenter_id"'" ] }' | jq "."
    The response includes a selfLink value.
  5. Assign the selfLink variable.
    selfLink_id='example-selfLink-alphanumeric-string'
  6. Use the selfLink variable to track the request.
    curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/request-tracker/$selfLink_id | jq "."
    The VMware Cloud on AWS cloud account is created when the response shows "status": "FINISHED".

Example: Create a VMC Cloud Account with a Proxy

This example creates a VMware Cloud on AWS cloud account with a cloud proxy VM that has been manually deployed.

Assign the required variables.

$ url='https://appliance.domain.com' $ api_version='2021-07-15'

List all cloud proxies.

$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/data-collectors?api_version=$api_version" | jq "."

A snippet of the response from your request shows the data collector IDs.

... { "dcId": "cd7d1eb4-573f-4150-8206-de3d536490ca", "ipAddress": "10.139.116.60", "name": "localhost.localdom", "hostName": "localhost.localdom", "status": "ACTIVE" },, ...

Assign the data collector ID variable.

$ data_collector_id='cd7d1eb4-573f-4150-8206-de3d536490ca'

Assign the variables for the VMC cloud account.

$ vmc_data_collector_id=a1235a7f-d49f-4365-8ed9-2d7d0805e4bc $ vmc_api_token=ab392fba-32a8-49a5-a084-d422fa32c5b8 $ vmc_sddc_name=MYCOM-PRD-NSXT-M7GA-052019 $ vmc_vcenter_private_ip=10.70.57.196 $ vmc_nsx_manager_ip=10.70.57.131 $ vmc_vcenter_username=cloudadmin@vmc.local $ vmc_vcenter_password=aBcqCW+m4+XEQg7 $ vmc_vcenter_datacenter_id=Datacenter:datacenter-1

Create a VMC cloud account named demo-vmc-account.

$ curl -X POST \ "$url/iaas/api/cloud-accounts?apiVersion=$api_version" \ -H "Authorization: Bearer $access_token" \ -H 'Content-Type: application/json' \ -d '{ "name": "demo-vmc-account", "description": "VMC cloud account", "cloudAccountType": "vmc", "privateKeyId": "'"$vmc_vcenter_username"'", "privateKey": "'"$vmc_vcenter_password"'", "cloudAccountProperties": { "sddcId": "'"$vmc_sddc_name"'", "apiKey": "'"$vmc_api_token"'", "hostName": "'"$vmc_vcenter_private_ip"'", "nsxHostName": "'"$vmc_nsx_manager_ip"'", "dcId": "'"$vmc_data_collector_id"'", "acceptSelfSignedCertificate": "false" }, "regionIds": [ "'"$vmc_vcenter_datacenter_id"'" ] }' | jq "."

The response includes a selfLink variable.

{ "progress": 0, "status": "INPROGRESS", "name": "Cloud account creation/update", "id": "0dc374ba-08ec-4422-8615-24f4f94ef5aa", "selfLink": "/iaas/api/request-tracker/0dc374ba-08ec-4422-8615-24f4f94ef5aa" }

Assign the selfLink variable.

selfLink_id='0dc374ba-08ec-4422-8615-24f4f94ef5aa'

Use the selfLink variable to track the request.

curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/request-tracker/$selfLink_id | jq "."

When the request completes successfully, the response shows the cloud account ID at the end of the resources path.

{ "progress": 100, "status": "FINISHED", "resources": [ "/iaas/api/cloud-accounts/e6af1aa6-dc7a-4847-8adc-c4c73727e5b3" ], "name": "Cloud account creation/update", "id": "a85d1476-1b11-45b0-8d14-91951385c95d", "selfLink": "/iaas/api/request-tracker/a85d1476-1b11-45b0-8d14-91951385c95d" }