如何使用API获取与SVM关联的聚合列表?
适用场景
- ONTAP 9
- API
问题解答
可以、我们可以列出与SVM关联的聚合:
- 从API:
卷曲:
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"
请求URL:
https://<Cluster-IP>/api/svm/svms?fields=aggregates&return_records=true&return_timeout=15
示例:
{
"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
}
- 从命令行界面:
::*> 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.
在上面的示例中、我们可以看到Vserver "vm1" 有一个 聚合 、即aggr1、 而Vserver "test"有两个聚合 、即aggr1和aggr2。
追加信息
- 检索SVM和SVM属性
- 如果获取"
Error: command failed: Cannot create volume. Reason: aggregate aggr1 is not in aggr-list of Vserver test
" - 考虑添加聚合以报告SVM (将本地层(聚合)分配给Storage VM (SVM))
- SVM根卷移动失败、并显示-aggr-list错误