Add a VMware Managed Cloud Account
To create a VMware Managed Cloud (VMC) account, you make a POST request. The request body includes the VMC-specific parameters required to create the cloud account.
Prerequisites
- Verify that all general prerequisites have been satisfied. See Prerequisites for working with the vRealize Automation Cloud Assembly APIs.
- Verify that you have the
following parameters for the new cloud account:
- VMC API token
- VMC SDDC name
- VMC vCenter private IP
- VMC NSX Manager IP
- VMC vCenter user name
- VMC vCenter password
- VMC vCenter data center ID
Procedure
Example: Create a VMC Account
This example creates an NSX-V cloud account that includes an existing vSphere cloud account.
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 VMC account variables.
$ 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 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 "."
A snippet of the response from your request shows the account ID.
...
"tags": [],
"name": "demo-vmc-account",
"description": "VMC cloud account",
"id": "e2188ee5e1da675590a4d60dfaf2",
"updatedAt": "2021-08-02",
"organizationId": "6ab4d969-1f2a-4db8-a712-78d34239d1d2",
"orgId": "6ab4d969-1f2a-4db8-a712-78d34239d1d2",
...