#Problem with na_ontap_snapshot_policy

1 messages · Page 1 of 1 (latest)

daring pendant
#

Hello, I noticed a strange behavior with snapshot_policy module (I'm using netapp.ontap 23.0.0)

When I try to delete a policy with state=absent, the playbook doesn't delete it if vserver variable is set. (EDIT: this happens only if the vserver name is the cluster vserver)

- name: Delete Snapshot policy
  netapp.ontap.na_ontap_snapshot_policy:
    state: absent
    name: ansible2
    vserver: foo
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    hostname: "{{ netapp_hostname }}"
    https: false

Is that by design?

Thank you all

flint saffron
#

if the policy belongs to the cluster it might still be used on some other volumes, so it can't delete it

daring pendant
#

@flint saffron the issue came up when I was trying to delete a policy of the cluster vserver, but when I omit vserver variable, policy is been correctly deleted (policy was not used in any of the volumes).

livid hound
#

Usually for the REST modules you only set the vserver property when the object belongs to a vserver. Omit the vserver property if you operate on the cluster level. The module documentation is not always very clear about that fact.

#

This is different from ZAPI and command line usage. It stems from (in my opinion) poor design choices in the REST API.

daring pendant
#

It seems also that snapshot policy name must be unique across the cluster (you can't have the same name in 2 different SVMs), which makes me think that vserver parameter is not needed for delete...