How to get list of aggregates associated to SVM using API ?
Applies to
- ONTAP 9
- API
Answer
Yes, we can list aggregates which are associated to SVMs:
- From API:
Curl:
curl -X GET "https://<Cluster-IP>/api/svm/svms?fields=aggregates&return_records=true&return_timeout=15" -H "accept: application/json" -H "authorization: Basic YWRxxxxxxxxx546gfnfda"
Request URL:
https://<Cluster-IP>/api/svm/svms?fields=aggregates&return_records=true&return_timeout=15
Sample:
{
"records": [
{
"uuid": "c537a90a-85eb-11ef-8fe0-00a098daafd4",
"name": "svm1",
"aggregates": [
{
"name": "aggr1",
"uuid": "68feeb17-657a-422c-b80a-4987963ce002"
}
]
},
{
"uuid": "eb403c17-89e7-11ef-8fe0-00a098daafd4",
"name": "test",
"aggregates": [
{
"name": "aggr2",
"uuid": "cd757222-0dba-49fe-ab15-b541cf9abe83"
},
{
"name": "aggr1",
"uuid": "68feeb17-657a-422c-b80a-4987963ce002"
}
]
}
],
"num_records": 2
}
- From CLI:
::*> vserver show -fields aggr-list
vserver aggr-list
------- ---------
Cluster -
fas8200-2n-rtp-5 -
fas8200-rtp-12a -
fas8200-rtp-12b -
svm1 aggr1
test aggr2,aggr1
6 entries were displayed.
In above Example, we could see vserver 'svm1' have one aggregate – aggr1, whereas vserver 'test' have two aggregates – aggr1 & aggr2.
Additional Information
- Retrieve SVMs and SVM properties
- If getting "
Error: command failed: Cannot create volume. Reason: aggregate aggr1 is not in aggr-list of Vserver test
" - Considering adding aggregate for reporting vserver (Assign local tiers (aggregates) to storage VMs (SVMs))
- SVM Root volume move fails with -aggr-list error