Activating an SDDC for VMware Aria Automation automatically deploys a VM and creates a VMware Cloud on AWS cloud account. You do not need a cloud proxy VM. The POST request to create a VMware Cloud on AWS cloud account only requires parameters specific to VMware Cloud on AWS and does not require a data collector ID.

If an SDDC has not been activated for VMware Aria Automation, you activate it using Automation Assembler. See Create a VMware Cloud on AWS cloud account in VMware Aria Automation for an SDDC within a US region.

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 you have the following parameters for the new cloud account:
    • SDDC name.
    • vCenter private IP.
    • NSX Manager IP.
    • vCenter user name.
    • vCenter data center ID.
    • vCenter data center name.

Procedure

  1. Assign the account variables for the VMC cloud account.
    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_datacenter_id='<your_datacenter_id>'
    vmc_vcenter_datacenter_name='<your_datacenter_name>'
    
  2. 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 '{
        "cloudAccountProperties": {     
            "hostName": "'"$vmc_vcenter_private_ip"'",
            "acceptSelfSignedCertificate": "false"    
            "nsxHostName": "'"$vmc_nsx_manager_ip"'",     
            "sddcId": "'"$vmc_sddc_name"'"
        },
        "privateKey": "ignore",
        "createDefaultZones": false,
        "regions": [
          { 
            "externalRegionId": "'"$vmc_datacenter_id"'",
            "name": "'"$vmc_datacenter_name"'"
          }
        ],
        "customProperties": {
            "environment": "aap"
        },
        "cloudAccountType": "vmc",  
        "name": "<your-vmc-account-name>",
        "description": "<your VMC cloud account description>", 
        "privateKeyId": "'"$vmc_vcenter_username"'"
      }' | jq "."
    The response includes a selfLink value that you use to track the progress of the cloud account creation.
    Note: If the SDDC has not been activated for VMware Aria Automation, the request will fail with a 403 error response as in the following example.
    {
        "documentKind": "string",
        "messageId": "string",
        "details": [
            "SHOULD_RETRY"
        ],
        "serverErrorId": "string",
        "stackTrace": [
            "string"
        ],,
        "message": "string",
        "statusCode":0
    }

    To create the VMC cloud account, use Automation Assembler to activate the SDDC for VMware Aria Automation.

  3. Assign the selfLink variable.
    selfLink_id='example-selfLink-alphanumeric-string'
  4. 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 an SDDC activated for VMware Aria Automation

This example creates a VMware Cloud on AWS cloud account without requiring manual deployment of a cloud proxy VM.

Assign the required variables.

Note: If your organization uses an API service that is hosted outside of the United States, your URL variable must include a country abbreviation. See Regional Endpoints for VMware Aria Automation APIs.
$ url='https://api.mgmt.cloud.vmware.com'
$ api_version='2021-07-15'

Assign the variables for the VMC cloud account.

$ vmc_sddc_name='sddc_example'
$ vmc_vcenter_private_ip='10.2.224.4'
$ vmc_nsx_manager_ip='nsxManager.sddc-10-182-161-25.mycompanyvmc.com'
$ vmc_vcenter_username='[email protected]'
$ vmc_vcenter_datacenter_id='Datacenter:datacenter-1'
$ vmc_vcenter_datacenter_name='SDDC-Datacenter'

Create a VMC cloud account named vmc-account-SDDC-activated.

curl -X POST \
  "$url/iaas/api/cloud-accounts?apiVersion=$api_version" \
  -H "Authorization: Bearer $access_token" \
  -H 'Content-Type: application/json' \
  -d '{
    "cloudAccountProperties": {     
        "hostName": "'"$vmc_vcenter_private_ip"'",
        "acceptSelfSignedCertificate": "false"    
        "nsxHostName": "'"$vmc_nsx_manager_ip"'",     
        "sddcId": "'"$vmc_sddc_name"'"   
    },
    "privateKey": "ignore",
    "createDefaultZones": false,
    "regions": [
      { 
        "externalRegionId": "'"$vmc_vcenter_datacenter_id"'",
        "name": "'"$vmc_vcenter_datacenter_name"'"
      }
    ],
    "customProperties": {
        "environment": "aap"  
    },
    "cloudAccountType": "vmc",  
    "name": "vmc-account-using-activated-SDDC",
    "privateKeyId": "'"$vmc_vcenter_username"'"
  }' | jq "."

The response includes a selfLink variable.

{
    "progress": 0,
    "status": "INPROGRESS",
    "name": "Cloud account creation/update",
    "id": "a85d1476-1b11-45b0-8d14-91951385c95d",
    "selfLink": "/iaas/api/request-tracker/a85d1476-1b11-45b0-8d14-91951385c95d"
}

Assign the selfLink variable.

selfLink_id='a85d1476-1b11-45b0-8d14-91951385c95d'

Use the selfLink variable to track the progress of the cloud account creation.

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"
}