To create a vSphere Storage Profile that supports First Class Disk (FCD) storage, you make a POST request with a region ID and you include first class as the disk type property. Optional request body input includes a vSphere storage policy and a vSphere datastore.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Cloud Assembly Infrastructure as a Service (IaaS) service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have the cloud account ID for the vSphere cloud account that you added. See Add a vSphere Cloud Account.
Procedure
Example: Create vSphere Storage Profile with FCD storage
$ url='https://appliance.domain.com'
$ api_version='2022-04-02'
$ vsphere_cloud_account_id='683c647b-413d-4673-a236-08b3694cd652'
Look up region IDs associated with the cloud account and in the external region ID Datacenter:datacenter-3.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/regions/?apiVersion=$api_version&"'$filter'"=externalRegionId%20eq%20'Datacenter:datacenter-10'%20and%20cloudAccountId%20eq%20'"$vsphere_cloud_account_id"'" | jq "."
A snippet of the response shows the region ID.
... "externalRegionId": "Datacenter:datacenter-3", "name": "Example external region name", "cloudAccountId": "683c647b-413d-4673-a236-08b3694cd652", "id": "0f182edc-1155-4df1-a53a-2c46be7bc373", ...
Assign the vSphere region ID.
$ vsphere_region_id='0f182edc-1155-4df1-a53a-2c46be7bc373'
If using a vSphere storage policy, perform the following steps.
- List all vSphere storage policies.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-vsphere-storage-policies/?apiVersion=$api_version" | jq "."
A snippet of the response shows the storage policy.
... "externalId": "f31f2442-8247-4517-87c2-8d69d7a6c696", "name": "Management Storage Policy - Stretched", "description": "Management Storage policy used for VMC stretched cluster", "id": "4aad51f0b02b5275572d264d28490", ...
- Examine the response to assign the vSphere storage policy ID.
$ vsphere_storage_policy_id='4aad51f0b02b5275572d264d28490'
If provisioning a specific datastore or cluster, perform the following steps.
- List all vSphere datastores.
$ curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-vsphere-datastores/?apiVersion=$api_version" | jq "."
A snippet of the response shows the datastore.
... "externalId": "WorkloadDatastore", "name": "WorkloadDatastore", "id": "c4f1dd4741d05e75572d264dcc590", "createdAt": "2022-04-02", "updatedAt": "2022-04-02", ...
- Examine the response to assign the vSphere datastore ID.
$ vsphere_datastore_id='c4f1dd4741d05e75572d264dcc590'
Create a vSphere Storage Profile named vsphere-storage-profile-with-FCD.
$ curl -X POST \ $url/iaas/api/storage-profiles?apiVersion=$api_version \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "name": "vsphere-storage-profile-with-FCD", "description": "Example First Class Disk vSphere Storage Profile", "defaultItem": true, "provisioningType": "thin", "diskType": "firstClass", "regionId": "'$vsphere_region_id'", "tags": [ { "key": "type", "value": "fcd" } ] }' | jq "."
Included with storage profile ID, a snippet of the response shows the tags that you defined for the storage profile.
{ "defaultItem": true, "tags": [ { "key": "type", "value": "fcd" } ], "provisioningType": "thin", "externalRegionId": "Datacenter:datacenter-3", "cloudAccountId": "683c647b-413d-4673-a236-08b3694cd652", "diskType": "firstClass", "name": "vsphere-storage-profile-with-FCD", "description": "Example First Class Disk vSphere Storage Profile", "id": "6037ac02-83e0-41bb-ba6e-ed5784ae1101", "createdAt": "2022-04-02", "updatedAt": "2022-04-02", ...