#How to delete snapmirror but not break off with ansible?

1 messages · Page 1 of 1 (latest)

latent spade
#

On netapp cmode, you can do snapmirror delete without break off snapmirror. But with ansible na_ontap_snapmirror module, it seems that it's binary. It will break off and delete the snapmirror, which makes it impossible to resync/reconnect.

use below example:

    - name: delete snapmirror
      connection: local
      netapp.ontap.na_ontap_snapmirror:
        <<: *login
        state: absent
        destination_path: "{{ item.destination.path }}"
        relationship_info_only: true
        relationship_state: active
        source_path: "{{ item.source.path }}"
      loop: "{{ sm_list }}"
      tags: sm
    - name: restore snapmirror
      connection: local
      netapp.ontap.na_ontap_snapmirror:
        <<: *login
        state: present
        destination_path: "{{ item.destination.path }}"
        relationship_type: extended_data_protection
        relationship_state: active
        source_path: "{{ item.source.path }}"
      loop: "{{ sm_list }}"
      tags: sm

snapmirror cannot be reconnected/resync'd as it's in "Broken-off" state, source and destination have no common snapshots.

muted summit
#

i don't think you actually can delete the relationship in cmode if there is still "snapmirror list-destination" info on the source, even on the cli ... you can quiesce it or break it, but not delete it until the snapshots in the relationship are deleted .

#

it's not hard to test