You can retrieve the list of storage profiles that have been defined on a vCenter server registered to a cloud. To retrieve the list, you make a GET request to the server's storageProfiles link.
Storage profiles are named configurations of vCenter storage. When you create a Provider VDC, you must specify the name of at least one storage profile to provide storage capacity for that Provider VDC.
The VMWStorageProfiles of a VimServer element contains an entry for every storage profile that has been defined on the server. See Finding Available vCenter Resources.
■
| |
■
|
Retrieve the XML representation of a vCenter server registered to your cloud. See Finding Available vCenter Resources. |
1 | (Optional) Refresh the cached list of storage profiles. vCloud Director maintains a cache of the storage profiles that have been created on each of its registered vCenter servers. The cache is refreshed on a regular schedule, and is likely to contain an up-to-date list. If a vCenter administrator has recently created a new storage profile, you can force it to be added to the cache by following these steps. |
2 | Examine the VimServer element to locate its storageProfiles link. The link has the following form: <vcloud:Link rel="down" type="application/vnd.vmware.admin.storageProfiles+xml" href="https://vcloud.example.com/api/admin/extension/vimServer/9/storageProfiles" /> |
3 | GET the URL in the value of this link's href attribute to retrieve the list of storage profiles. See Example: Retrieve a List of Storage Profiles from a vCenter Server. |
GET https://vcloud.example.com/api/admin/extension/vimServer/9/storageProfiles
This response shows that the specified vCenter server contains three storage profiles, named Gold, Silver, and Bronze. Storage profile details, including datastore identifiers and capacities, are included in the response, but only the value of the name attribute of a VMWStorageProfile is needed when adding that storage profile to a Provider VDC.
200 OK Content-Type: application/vnd.vmware.admin.vmwstorageprofiles+xml ... <?xml version="1.0" encoding="UTF-8"?> <vmext:VMWStorageProfiles xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" ...> ... <vmext:VMWStorageProfile name="Gold"> <vmext:MoRef>storageProfile-CFAA6D92-36FC-4C16-9B30-FAC79B902371</vmext:MoRef> <vmext:VimObjectType>STORAGE_PROFILE</vmext:VimObjectType> <vmext:FreeStorageMb>169203.0</vmext:FreeStorageMb> <vmext:TotalStorageMb>325120.0</vmext:TotalStorageMb> <vmext:DataStoreRefs> <vmext:VimObjectRef> <vmext:VimServerRef type="application/vnd.vmware.admin.vmwvirtualcenter+xml" name="" href="https://vcloud.example.com/api/admin/extension/vimServer/9" /> <vmext:MoRef>datastore-44</vmext:MoRef> <vmext:VimObjectType>DATASTORE</vmext:VimObjectType> </vmext:VimObjectRef> <vmext:VimObjectRef> <vmext:VimServerRef type="application/vnd.vmware.admin.vmwvirtualcenter+xml" name="" href="https://vcloud.example.com/api/admin/extension/vimServer/9" /> <vmext:MoRef>datastore-45</vmext:MoRef> <vmext:VimObjectType>DATASTORE</vmext:VimObjectType> </vmext:VimObjectRef> </vmext:DataStoreRefs> </vmext:VMWStorageProfile> <vmext:VMWStorageProfile name="Silver"> ... </vmext:VMWStorageProfile> <vmext:VMWStorageProfile name="Bronze"> ... </vmext:VMWStorageProfile> </vmext:VMWStorageProfiles>