#How to capture only root volumes information using netapp.ontap.na_ontap_rest_info?

1 messages · Page 1 of 1 (latest)

small wigeon
#

Hi all,

I'd like to capture only root volume information, I tired below but it didn't work. Any idea on how I can get only root volume information? Thank you

netapp.ontap.na_ontap_rest_info:
gather_subset:
- storage/volumes
parameters:
svm.name: "{{ item }}"
name: "vol0*"
<<: *login
with_items: "{{ nodes }}"
register: result

eternal stone
#

Did the above give an error when you ran it?

small wigeon
#

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: []

eternal stone
#

and there are vol0* on test-c01-nas-n09 correct?

small wigeon
#

Yes

tight ember
tight ember
#

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"

small wigeon
#

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%

tight ember
#

is test-c01-nas-n09 a node vserver?
REST not returns volumes in node vserver, this may be restriction in REST API.

small wigeon
#

Node vserver.

tight ember
#

REST supports only data vserver