To validate placement scenarios before deploying a cloud template, you use the IaaS API to retrieve the request graph for a simulated provisioning request.

Prerequisites for retrieving provisioning request details

  • 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.
  • Assign an API version variable for the Blueprint API.
    api_version_blueprint='2019-09-12'
    Note: The Automation Assembler Infrastructure as a Service (IaaS) service and the Automation Assembler Blueprint service have different API version values. You set the API version value for the Automation Assembler Infrastructure as a Service (IaaS) service when you satisfied the general prerequisites.
  • Verify that you have the ID for the cloud template that you plan to deploy. See Create and Update a Cloud Template. You can also get the cloud template ID from the UI, by opening the cloud template listed on Design > Templates and inspecting the ID at the end of the URL.

Retrieving provisioning request details

This example shows how to get request details for a cloud template with the ID c8197446-d636-4ed9-aa2b-796da98ad10c. In the following procedure, you use the blueprint API to get the deployment ID and flow ID and provide those values as input for the IaaS API request graph endpoint.

Use the template ID to get the deployment ID and flow ID.

curl -X POST \
$url/blueprint/api/blueprint-requests?apiVersion=$api_version_blueprint \
-H 'Accept: application/json' \
-H "Authorization: Bearer $access_token" \
-d '{
    "deploymentId": null,
    "deploymentName": null,
    "description": null,
    "plan": false,
    "blueprintId": "c8197446-d636-4ed9-aa2b-796da98ad10c",
    "content": null,
    "simulate": true
} | jq "."

Examine the response to get the deployment ID and the flow ID.

{
    "id": "8b918325-21a7-4902-b464-f39f5fb1bb64",
    "createdAt": "2023-11-22T07:12:54.585430Z",
    "createdBy": "[email protected]",
    "updatedAt": "2023-11-22T07:12:54.585430Z",
    "updatedBy": "[email protected]",
    "orgId": "434f6917-4e34-4537-b6c0-3bf3638a71bc",
    "projectId": "267f8448-d26f-4b65-b310-9212adb3c455",
    "projectName": "testing",
    "deploymentId": "924fcbc3-2076-48c9-a5f5-64de7f1cbe3a",
    "requestTrackerId": "8b918325-21a7-4902-b464-f39f5fb1bb64",
    "deploymentName": "deployment_924fcbc3-2076-48c9-a5f5-64de7f1cbe3a",
    "reason": "Simulate",
    "plan": false,
    "destroy": false,
    "ignoreDeleteFailures": false,
    "simulate": true,
    "blueprintId": "c8197446-d636-4ed9-aa2b-796da98ad10c",
    "inputs": {},
    "status": "STARTED",
    "flowId": "8b918325-21a7-4902-b464-f39f5fb1bb64"
}

Use the deployment ID and flow ID to get the provisioning request details.

curl -X GET \
$url/iaas/api/request-graph?apiVersion=$api_version \
-H 'Accept: application/json' \
-H "Authorization: Bearer $access_token" \
-d '{
    "deploymentId": "924fcbc3-2076-48c9-a5f5-64de7f1cbe3a",
    "flowId": "8b918325-21a7-4902-b464-f39f5fb1bb64",
} | jq "."

Using the response to validate placement scenarios

The response provides task and project information for the simulated provisioning request.

The tasks section of the response lists the task ID and stages. To validate a placement scenario, the request must successfully transition through all stages and substages. Any stage that shows an error includes a failure message that you can use to troubleshoot the problem with the placement scenario.

In the following sample response, a snippet shows an error during the reserving stage. To validate the provisioning request, correct errors and rerun the API until all tasks finish successfully.
    "tasks": [
        {
            "id": "46414006-8f71-46f8-b965-eea0bacbba7e",
            "stages": [
                {
                    "transitionSource": {
                        "timestampMicros": 0
                    },
                    "taskSubStage": "CREATED",
                    "taskInfo": {
                        "stage": "STARTED",
                        "isDirect": false
                    },
                    "resourceLinks": [
                        "/iaas/api/machines/4323fd90-ad4e-4342-b9ca-62a9bb7193c9"
                    ],
                    "timestampMicros": 1702877437358001
                },
                ...
                    },
                    "taskSubStage": "ENHANCED",
                    "taskInfo": {
                        "stage": "STARTED",
                        "isDirect": false
                    },
                ...
                    },
                    "taskSubStage": "RESOURCE_COUNTED",
                    "taskInfo": {
                        "stage": "STARTED",
                        "isDirect": false
                    },
                ...
                    },
                    "taskSubStage": "RESERVING",
                    "taskInfo": {
                        "stage": "STARTED",
                        "isDirect": false
                    },
                ...
                    "taskSubStage": "ERROR",
                    "taskInfo": {
                        "stage": "STARTED",
                        "isDirect": false,
                        "failure": {
                            "message": "Cannot find matching image mappings for image: im1",
                            "statusCode": 0,
                            "errorCode": 0,
                            "serverErrorId": "ad4d91ea-4319-4f11-abcf-3601c08f3ecd",
                            "documentKind": "com:vmware:xenon:common:ServiceErrorResponse"
                        }
                   },
               ...
             }  
        ]   
The project section of the response provides reference information for the project associated with the template.
    "project": {
        "administrators": [],
        "members": [],
        "viewers": [],
        "supervisors": [],
        "zones": [
            {
                "zoneId": "8830680d-71d1-4dcb-8234-f22de4254c6b",
                "priority": 0,
                "maxNumberInstances": 0,
                "allocatedInstancesCount": 0,
                "memoryLimitMB": 0,
                "allocatedMemoryMB": 0,
                "cpuLimit": 0,
                "allocatedCpu": 0,
                "storageLimitGB": 0,
                "allocatedStorageGB": 0.0,
                "id": "8a342007-8e8a-432b-9a12-14ebb51e3c1a-8830680d-71d1-4dcb-8234-f22de4254c6b"
            }
        ],
        "constraints": {},
        "operationTimeout": 0,
        "sharedResources": true,
        "placementPolicy": "DEFAULT",
        "customProperties": {},
        "name": "p",
        "description": "",
        "id": "8a342007-8e8a-432b-9a12-14ebb51e3c1a",
        "orgId": "ce1fb992-7495-48fd-8988-412658094f6b",
        "_links": {
            "self": {
                "href": "/iaas/api/request-graph/8a342007-8e8a-432b-9a12-14ebb51e3c1a"
            }
        }
    }