To create a flavor mapping, you make a POST request with a region ID associated with a cloud account. The cloud account can be an AWS, vSphere, Azure, or GCP cloud account.
Cloud vendors use flavors, or instance types, to express standard deployment sizings such as small (1 CPU, 2 GB RAM) or large (2 CPU, 8 GB RAM) for compute resources. When you build a cloud template, you pick a flavor that fits your needs and map a flavor name to a value for each account or region.
The same API calls create a flavor profile for an AWS, vSphere, Azure, or GCP cloud account. However, the flavor mapping used to create the flavor profile varies for each type of cloud account. This procedure provides the steps to create a flavor profile for an AWS cloud account. Additional examples show how to create flavor profiles for vSphere and Azure cloud accounts.
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 cloud account ID for the new cloud account that you added. See Adding Cloud Accounts.
Procedure
Example: Create flavor mappings for different cloud accounts
Create a flavor mapping for an AWS cloud account.
- Assign the required variables including the cloud account ID for an AWS cloud account.
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' $ cloud_account_id='c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c403301 3bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d'
- Look up region IDs associated with the cloud account and in the external region ID us-east-1.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/regions/?apiVersion=$api_version&"'$filter'"=externalRegionId%20eq%20'us-east-1'%20and%20cloudAccountId%20eq%20'"$cloud_account_id"'" | jq "."
A snippet of the response shows the region ID.
... "externalRegionId": "us-east-1", "cloudAccountId": "c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c4033013bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d", "id": "37d6c1acf4a8275586468873c739", "updatedAt": "2022-04-02", ...
- Assign the AWS region ID.
$ aws_region_id='37d6c1acf4a8275586468873c739'
- List all fabric flavors.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-flavors/?apiVersion=$api_version" | jq "."
A snippet of the response shows a fabric flavor name with its resource size.
... { "id": "t2.micro", "name": "t2.micro", "cpuCount": 1, "memoryInMB": 1024, "storageType": "EBS", "networkType": "Low to Moderate" }, ...
- Select fabric flavor names with resources that fit your needs and create an AWS flavor profile named aws-flavor-profile.
$ curl -X POST \ $url/iaas/api/flavor-profiles?apiVersion=$api_version \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "name":"aws-flavor-profile", "description":"Example AWS Compute flavors", "flavorMapping": { "small": { "name":"t2.micro" }, "medium": { "name":"t2.medium" }, "large":{ "name":"t2.large" } }, "regionId":"'$aws_region_id'" }' | jq "."
A snippet of the response shows the flavor profile ID.
... "externalRegionId": "us-east-1", "name": "aws-flavor-profile", "description": "Example AWS Compute flavors", "id": "835249077934b47558eca5963e068", "updatedAt": "2022-04-02", ...
Create a flavor mapping for a vSphere cloud account.
- Assign the required variables including the cloud account ID for a vSphere cloud account.
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' $ cloud_account_id='c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c403301 3bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d'
- Look up region IDs associated with the cloud account and in the external region ID Datacenter:datacenter-2.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/regions/?apiVersion=$api_version&"'$filter'"=externalRegionId%20eq%20'Datacenter:datacenter-2'%20and%20cloudAccountId%20eq%20'"$cloud_account_id"'" | jq "."
A snippet of the response shows the region ID.
... "externalRegionId": "Datacenter:datacenter-2", "cloudAccountId": "c8c3c9bfdb449475-7f703c5265a63d87-d06bf79904ce5096492a2a2fc557fb0457d7d3c5b5e7ae20b29957788812bb3d-d5a5e16bdc3eec7557245925e1b08", "id": "2aaf79b789eee8755724592b06d39", "updatedAt": "2022-04-02", ...
- Assign the vSphere region ID.
$ vsphere_region_id='2aaf79b789eee8755724592b06d39'
- Create a vSphere flavor profile named vcenter-flavor-profile.
$ curl -X POST \ $url/iaas/api/flavor-profiles?apiVersion=$api_version \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "name":"vcenter-flavor-profile", "description":"Example vSphere Compute flavors", "flavorMapping": { "small": { "cpuCount":1, "memoryInMB": 1024 }, "medium": { "cpuCount":2, "memoryInMB": 2048 }, "large":{ "cpuCount":4, "memoryInMB": 4096 } }, "regionId":"'$vsphere_region_id'" }' | jq "."
A snippet of the response shows the flavor profile ID.
... "externalRegionId": "Datacenter:datacenter-2", "name": "vcenter-flavor-profile", "description": "Example vSphere Compute flavors", "id": "cfb7246505319275572e9e68372d0", "updatedAt": "2022-04-02", ...
Create a flavor mapping with an Azure cloud account ID.
- Assign the required variables including the cloud account ID for an Azure cloud account.
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' $ cloud_account_id='c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c403301 3bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d'
- Look up region IDs associated with the cloud account and in the external region ID us-east-1.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/regions/?apiVersion=$api_version&"'$filter'"=externalRegionId%20eq%20'us-east-1'%20and%20cloudAccountId%20eq%20'"$cloud_account_id"'" | jq "."
A snippet of the response shows the region ID.
... "externalRegionId": "us-east-1", "cloudAccountId": "c8c3c9bfdb449475-7f703c5265a63d87-5fa34c478df36b060e1ca3551254c4033013bf3283908e4661cd1c6fb2f8b9ae-ce5aad01092b47558644f6b6615d", "id": "37d6c1acf4a8275586468873c739", "updatedAt": "2022-04-02", ...
- Assign the Azure region ID.
$ azure_region_id='37d6c1acf4a8275586468873c739'
- List all fabric flavors.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-flavors/?apiVersion=$api_version" | jq "."
A snippet of the response shows a fabric flavor name with its resource size.
... { "id": "Standard_A0", "name": "Standard_A0", "cpuCount": 1, "memoryInMB": 768, "bootDiskSizeInMB": 1047552, "dataDiskSizeInMB": 20480, "dataDiskMaxCount": 1 }, ...
- Select fabric flavor names with resources that fit your needs and create an Azure flavor profile named azure-flavor-profile.
$ curl -X POST \ $url/iaas/api/flavor-profiles?apiVersion=$api_version \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "name":"azure-flavor-profile", "description":"Example Azure Compute flavors", "flavorMapping": { "small": { "name":"Standard_A0" }, "medium": { "name":"Standard_A1" }, "large":{ "name":"Standard_A2" } }, "regionId":"'$azure_region_id'" }' | jq "."
A snippet of the response shows the flavor profile ID.
... "externalRegionId": "us-east-1", "name": "azure-flavor-profile", "description": "Example Azure Compute flavors", "id": "4965d34c3bfe0275574bc6e505b78", "updatedAt": "2022-04-02", ...