VMware Cloud Sizer API

VMware Cloud Sizer API

This API contract provides totals based sizing recommendations for VMware Cloud environments based on input workload characteristics.

  • Step 1 - Obtain a VMware Cloud API Token. Calling Sizer API requires an API Token and you will need to navigate to the Cloud Services Provider and create a new API Token (requires login). Your API Token will be an alpha-numeric string. The API Token is a long lived token. Also this is a one time step (until the token expires).

  • Step 2 - Exchanging your API Token for an Access Token. With your API Token you will need to use the CSP Identity and Access Management group of APIs and fetch an "access token". Here's the API you'll need:

    POST Exchange Scoped Token For Access
  • Step 3 - Call the Sizing APIs in logged-in mode (listed above) Call the Sizer API with the bearer token (obtained from Step 2) as part of the Authorization header.



    Note - There is a limitation with VMware Developer portal, where some float/double values are rounded off. Please pay attention to the values passed in your request as it might result in incorrect sizing or an error.

Getting Started with VMware Cloud Sizer REST APIs in 5 Minutes

VMware Sizer helps you with the sizing recommendations for VMware Cloud environments based on On-Premises workload characteristics.

About VMware Cloud Sizer API Programming

There is one core module that is exposed currently:

Recommendation API would recommend the number of hosts and resources required for a set of workload profiles.

This API contract provides totals based sizing recommendations for VMware Cloud environments based on input workload characteristics. This version of recommendation API needs an access token to be sent as part of the Authorization header. Steps to obtain an access token is listed below.

  • Obtain a VMware Cloud API Token. Calling Sizer API requires an API Token and you will need to navigate to the Cloud Services Provider and create a new API Token (requires login). Your API Token will be an alpha-numeric string. The API Token is a long lived token. Also this is a one time step (until the token expires).

  • Exchanging your API Token for an Access Token. With your API Token you will need to use the CSP Identity and Access Management group of APIs and fetch an “access token”. Here’s the API you’ll need: Exchange Scoped Token For Accessn

For generating access token, the request would be something like:

curl --request POST 'https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/authorize?refresh_token={refresh_token}' \
--header 'Content-Type: application/x-www-form-urlencoded'
 

Call the Sizer API with the bearer token(obtained from above steps) as part of the Authorization header. A sample sizing recommendation request for a set of VMs is given below.

curl --request POST 'https://vmc.vmware.com/api/vmc-sizer/v5/recommendation' \
--header 'Authorization: Bearer {{Access Token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "configurations": {
      "sddcHostType": "COST_OPT"
    },
    "workloadProfiles": [
      {
        "vmList": [
          {
            "vmName": "CORP-GIS10",
            "vmState": "RUNNING",
            "vmComputeInfo": {
              "vCpu": 2.0,
              "vCpuOverall": 502.0
            },
            "vmMemoryInfo": {
              "vRam": 28.0,
              "vRamConsumed": 28641.0,
              "ramOverhead": 142.0
            },
            "vmStorageInfo": {
              "vmdkTotal": 1835.55,
              "vmdkUsed": 1827.98
            }
          },
          {
            "vmName": "pwsldsprecpr001.client.ext",
            "vmState": "RUNNING",
            "vmComputeInfo": {
              "vCpu": 2.0,
              "vCpuOverall": 53.0
            },
            "vmMemoryInfo": {
              "vRam": 4.0,
              "vRamConsumed": 4073.0,
              "ramOverhead": 52.0
            },
            "vmStorageInfo": {
              "vmdkTotal": 62.11,
              "vmdkUsed": 62.11
            }
          }
        ]
    }
]
}'