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 Automation Assembler 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
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://api.mgmt.cloud.vmware.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 $ [email protected] $ 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" }