Create a First Class Disk
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.
- Verify that all general prerequisites and prerequisites for theAutomation AssemblerInfrastructure 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 thedefaultItemand the tags from the response. See Create a vSphere Storage Profile for a First Class Disk.
- Assign the project ID variable.project_id='<your_project_id>'
- Set the capacity and persistence for the disk.capacity_in_gb=<integer> persistence=<true|false>
- Deploy the FCD.
- Withmandatoryset to true, all tags in theexpressionmust match a storage profile, otherwise provisioning fails.
- Theexpressionis the key:value tag pair used to create the storage profile. See Create a vSphere Storage Profile for a First Class Disk.
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 includes a selfLink value.{ "progress": 0, "status": "INPROGRESS", "name": "Provisioning", "id": "example-selfLink-alphanumeric-string", "selfLink": "/iaas/api/request-tracker/example-selfLink-alphanumeric-string" } - Assign the selfLink variable.selfLink_id='example-selfLink-alphanumeric-string'
- Use the selfLink variable to track the progress of the FCD creation.curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" $url/iaas/api/request-tracker/$selfLink_id?apiVersion=$api_version | jq "."In the list of resources, the response includes block devices with the block device ID in the path.{ "progress": 100, "message": "success", "status": "FINISHED", "resources": [ "/iaas/api/block-devices/example-blockdevice-alphanumeric-string" ], ... }
- Assign the block device ID variable.block_device_id='example-blockdevice-alphanumeric-string'
- Retrieve the created block device object.curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" $url/iaas/api/block-devices/$block_device_id?apiVersion=$api_version | jq "."
- Retrieve all the FCD block device types.curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/block-devices?%24filter=customProperties.diskType%20eq%20firstClass&apiVersion=$api_version" | jq "."
- Delete the FCD block device.curl -X DELETE -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" $url/iaas/api/block-devices/$block_device_id?apiVersion=$api_version | jq "."
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'
Use the block device ID to attach
your FCD to a VM and manage your FCD snapshots. See Attach a First Class Disk and
Manage First Class Disk Snapshots.