#How to capture only root volumes information using netapp.ontap.na_ontap_rest_info?
1 messages · Page 1 of 1 (latest)
Did the above give an error when you ran it?
No, it ran fine without finding vol0* volumes. I’ll capture the output of above task and send it over in few minutes
@eternal stone below is the output i got. ok: [localhost] => (item=test-c01-nas-n09) => changed=false
ansible_loop_var: item
item: test-c01-nas-n09
ontap_info:
storage/volumes:
_links:
self:
href: /api/storage/volumes?max_records=1024&fields=&svm.name=test-c01-nas-n09&name=vol0%2A
num_records: 0
records: []
and there are vol0* on test-c01-nas-n09 correct?
Yes
there is a similar question - https://discordapp.com/channels/855068651522490400/1069925730017869854
sorry, above question is for aggregates.
I tried this, it worked
- name: Gather root volume na_ontap_rest_info: gather_subset: - storage/volumes parameters: name: NVMe*
response
"records": [
{
"name": "NVMe_svm_root",
},
"name": "NVMe_svm_1_root",
}
]
is this tried name: "vol0*" instead "vol0"
I tried vol0* and it didn’t give me any output for volumes starting with vol0. There are few volumes with starting with vol0 on the node
I ran below code with name: vol0* instead of "vol0*" and get the same result
- name: Run ONTAP gather facts for volume info with query on name
netapp.ontap.na_ontap_rest_info:
gather_subset:
- storage/volumes
parameters:
svm.name: "{{ item }}"
name: vol0*
<<: *login
with_items: "{{ nodes }}"
register: result
vars:
nodes:
- test-c01-nas-n09
TASK [Run ONTAP gather facts for volume info with query on name] ********************
ok: [localhost] => (item=test-c01-nas-n09) => changed=false
ansible_loop_var: item
item: test-c01-nas-n09
ontap_info:
storage/volumes:
_links:
self:
href: /api/storage/volumes?max_records=1024&fields=&svm.name=test-c01-nas-n09&name=vol0%2A
num_records: 0
records: []
test-c01-nas::> vol show vol0* -vserver test-c01-nas-n09
Vserver Volume Aggregate State Type Size Available Used%
test-c01-nas-n09 vol0_n09 aggr0_test_c01_nas_n09 online RW 966.0GB 828.8GB 9%
is test-c01-nas-n09 a node vserver?
REST not returns volumes in node vserver, this may be restriction in REST API.
Node vserver.
REST supports only data vserver