#Enabling ONTAP volume Analytics and Activity Tracking

1 messages · Page 1 of 1 (latest)

viral canyon
#

Hi there, I'm trying to configure ONTAP volumes with an Ansible playbook using the netapp.ontap.na_ontap_volume Ansible module: https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_volume_module.html#parameter-analytics

The following code in my task works fine for analytics, it shows as "on"

 ```- name: Create volume
   netapp.ontap.na_ontap_volume:
     foo: '123'
     bar: '456'
     analytics: 'off'```

But I can't find an option for activity tracking...

I experimented with feature flags and tried this:

           "auto_enable_analytics": 'on'
           "auto_enable_activity_tracking": 'on'``` 

... which runs but doesn't do anything. 

Has anyone else managed to do this as code in an Ansible playbook? I also experimented with the Rest API making direct calls but didn't have success there either, but I'm sure it must be possible.
glad valley
#

feature_flags won't work this way. It is about features of the collection, like enable API tracing.
I also can't find it in the docs so I guess it wasn't implemented yet. Doing it directly with the REST API should be working, according to the API docs it was introduced in 9.10. Untested example:
- name: Enable Activity Tracking on existing volume netapp.ontap.na_ontap_restit: api: storage/volumes/{uuid} method: POST body: activity_tracking: state: on

sonic epoch
viral canyon
#

@glad valley thanks a lot and sorry for the late reply - this works, I'm just trying to find a way of getting the UUID of a volume which I have the name for without running a GET request on all volumes and then filtering the output. Making good progress though 👍

glad valley
#

That's easy. Just use the na_ontap_rest_info module.

#

Should work like this. Untested example:
`- name: Get Volume UUID
netapp.ontap.na_ontap_rest_info:
gather_subset: storage/volumes
use_python_keys: true
parameters:
name: "{{ volume_name }}"
register: volinfo

  • debug:
    var: volinfo.ontap_info.storage_volumes.records[0].uuid`
viral canyon
#

That does work but there are unfortunately some other volumes in the cluster using identical names. I'm trying to filter by SVM. E.g. search for "foo" svm and "bar" volume so we get one specific volume belonging to a specific SVM.

I'm still playing around with this but if i find a solution i'll post it here

glad valley
#

adding svm.name: "{{ svm_name }}" to the parameters should solve that