Create a vCloud Air Reservation

You can use the vRealize Automation REST API reservation service to create a vCloud Air reservation.

Prerequisites

In addition to the Prerequisites, perform the following tasks before creating a reservation.

Procedure

Create a vCloud Air reservation.
curl --insecure -H "Accept:application/json" 
-H "Authorization: Bearer $token" 
https://$vRA/reservation-service/api/reservations -d “
{
  "name": "TestvAppReservation",
  "reservationTypeId": "Infrastructure.Reservation.Cloud.vCloudAir",
  "tenantId": "qe",
  "subTenantId": "a5d056be-3aa2-4fdd-ba1e-a3805f26f0e0",
  "enabled": true,
  "priority": 1,
  "reservationPolicyId": null,
  "alertPolicy": {
    "enabled": false,
    "frequencyReminder": 0,
    "emailBgMgr": true,
    "recipients": [
      
    ],
    "alerts": [
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "storage",
        "id": "storage"
      },
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "memory",
        "id": "memory"
      },
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "cpu",
        "id": "cpu"
      },
      {
        "alertPercentLevel": 80,
        "referenceResourceId": "machine",
        "id": "machine"
      }
    ]
  },
  "extensionData": {
    "entries": [
      {
        "key": "computeResource",
        "value": {
          "type": "entityRef",
          "componentId": null,
          "classId": "ComputeResource",
          "id": "c527a0f5-b1ae-4b61-8145-ad9d5c434dc7",
          "label": "Engineering Allocation VDC"
        }
      },
      {
        "key": "machineQuota",
        "value": {
          "type": "integer",
          "value": 0
        }
      },
      {
        "key": "allocationModel",
        "value": {
          "type": "integer",
          "value": 0
        }
      },
      {
        "key": "reservationNetworks",
        "value": {
          "type": "multiple",
          "elementTypeId": "COMPLEX",
          "items": [
            {
              "type": "complex",
              "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
              "componentId": null,
              "classId": "Infrastructure.Reservation.Network",
              "typeFilter": null,
              "values": {
                "entries": [
                  {
                    "key": "networkPath",
                    "value": {
                      "type": "entityRef",
                      "componentId": null,
                      "classId": "Network",
                      "id": "42c5063c-5422-448f-aac7-22ebe941ac8e",
                      "label": "VM Network SQA"
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "key": "reservationStorages",
        "value": {
          "type": "multiple",
          "elementTypeId": "COMPLEX",
          "items": [
            {
              "type": "complex",
              "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
              "componentId": null,
              "classId": "Infrastructure.Reservation.Storage",
              "typeFilter": null,
              "values": {
                "entries": [
                  {
                    "key": "computeResourceStorageTotalSizeGB",
                    "value": {
                      "type": "integer",
                      "value": 1000
                    }
                  },
                  {
                    "key": "storagePath",
                    "value": {
                      "type": "entityRef",
                      "componentId": null,
                      "classId": "Storage",
                      "id": "e655aa78-e5fb-4722-9e8a-0cd4139248cf",
                      "label": "High Performance Storage"
                    }
                  },
                  {
                    "key": "storagePriority",
                    "value": {
                      "type": "integer",
                      "value": 1
                    }
                  },
                  {
                    "key": "storageReservedSizeGB",
                    "value": {
                      "type": "integer",
                      "value": 100
                    }
                  },
                  {
                    "key": "storageEnabled",
                    "value": {
                      "type": "boolean",
                      "value": true
                    }
                  },
                  {
                    "key": "computeResourceStorageFreeSizeGB",
                    "value": {
                      "type": "integer",
                      "value": 691
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "key": "reservationMemory",
        "value": {
          "type": "complex",
          "componentTypeId": "com.mycompany.csp.iaas.blueprint.service",
          "componentId": null,
          "classId": "Infrastructure.Reservation.Memory",
          "typeFilter": null,
          "values": {
            "entries": [
              {
                "key": "computeResourceMemoryTotalSizeMB",
                "value": {
                  "type": "integer",
                  "value": 13312
                }
              },
              {
                "key": "memoryReservedSizeMb",
                "value": {
                  "type": "integer",
                  "value": 4096
                }
              }
            ]
          }
        }
      }
    ]
  }
} 
“

Example: Create a vCloud Air Reservation

The output is a location URL, including the new vCloud Air reservation ID.
Location:
https://$vRA/reservation-service/api/reservations/3289b039-2a11-4ab4-a0bc-b583e4c6d085