Create a vSphere Storage Profile for a First Class
Disk
vSphere
Storage Profile for a First Class
DiskTo 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. - 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 the cloud account ID for thevSpherecloud account that you added. See Add a vSphere Cloud Account.
- Assign the cloud account ID variable.vsphere_cloud_account_id='<your_cloud_account_id>'
- Look up region IDs associated with the cloud account and in the external region IDDatacenter: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-3'%20and%20cloudAccountId%20eq%20'"$vsphere_cloud_account_id"'" | jq "."
- Examine the response to find the ID for the region that you want.
- Assign the region ID variable.vsphere_region_id='<your_region_id>'
- If using avSpherestorage policy, list allvSpherestorage policies. If using a default storage policy, skip this step.curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-vsphere-storage-policies/?apiVersion=$api_version" | jq "."Examine the response and assign thevSpherestorage policy ID.vsphere_storage_policy_id='<your_vsphere_storage_policy_id>'
- If using avSpheredatastore, list allvSpheredatastores. If provisioning any datastore or cluster, skip this step.curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/fabric-vsphere-datastores/?apiVersion=$api_version" | jq "."Examine the response and assign thevSpheredatastore ID.vsphere_datastore_id='<your_vsphere_datastore_id>'
- Create avSphereStorage Profile with the FCD property.curl -X POST \ $url/iaas/api/storage-profiles?apiVersion=$api_version \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $access_token" \ -d '{ "name": "<your_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 "."
- Examine the response.
- "defaultItem": trueindicates that this storage profile is the default for the region.
- Tags help you to locate, manage, and work with the infrastructure resources.
Create
vSphere
Storage Profile
with FCD storageAssign the required variables including
the cloud account ID for a
vSphere
cloud account.$ 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 allvSpherestorage 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 thevSpherestorage 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 thevSpheredatastore 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", ...
Use the tags to create a First
Class Disk. See Create a First Class Disk.