To create a First Class Disk (FCD), you make a POST request using the block device specification. The request body includes a project ID, disk capacity, persistence setting, and constraints from the vSphere Storage Profile for an FCD creation.
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 added a project and you have the project ID. See Create a Project to use in Automation Assembler.
- Know the capacity of the disk and the persistence of the disk that you are creating.
- Verify that you have created a storage profile for an FCD and that you have the
defaultItem
and the tags from the response. See Create a vSphere Storage Profile for a First Class Disk.
Procedure
Example: Create a First Class Disk
With constraints from a vSphere Storage Profile for FCD storage, use the block device specification to deploy a First Class Disk for a project ID with a two GB capacity and persistence set to false.
$ url='https://appliance.domain.com'
$ api_version='2021-07-15'
$ project_id='f5357a28-df59-47e0-b983-8a562910d0be'
$ capacity_in_gb=2
$ persistent=false
Deploy the FCD.
$ curl -X POST \ $url/iaas/api/block-devices?apiVersion=$api_version \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "projectId": "'$project_id'", "name": "FCD-example", "capacityInGB": "'$capacity_in_gb'", "persistent" : "'$persistent'", "constraints": [ { "mandatory": "true", "expression": "type:fcd" } ] }' | jq "."
The response provides a selfLink to the request.
{ "progress": 0, "status": "INPROGRESS", "name": "Provisioning", "id": "86707da6-d5d6-4ebc-94a2-0a22f3fcb794", "selfLink": "/iaas/api/request-tracker/86707da6-d5d6-4ebc-94a2-0a22f3fcb794" }
Assign the selfLink ID variable.
$ selfLink_id='86707da6-d5d6-4ebc-94a2-0a22f3fcb794'
Track the progress of the request.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" $url/iaas/api/request-tracker/$selfLink_id?apiVersion=$api_version | jq "."
After the request completes successfully, the response provides the block device ID.
{ "progress": 100, "message": "success", "status": "FINISHED", "resources": [ "/iaas/api/block-devices/e1cbc8e1-76bb-4bef-8e51-a582437266c2" ], "name": "Provisioning", "id": "86707da6-d5d6-4ebc-94a2-0a22f3fcb794", "selfLink": "/iaas/api/request-tracker/86707da6-d5d6-4ebc-94a2-0a22f3fcb794" }
Assign the block device ID variable.
$ block_device_id='e1cbc8e1-76bb-4bef-8e51-a582437266c2'