ansible / ansible.builtin / v2.9.26 / module / na_ontap_snapmirror NetApp ONTAP or ElementSW Manage SnapMirror | "added in version" 2.7 of ansible.builtin" Authors: NetApp Ansible Team (@carchi8py) <ng-ansibleteam@netapp.com> preview | supported by certifiedansible.builtin.na_ontap_snapmirror (v2.9.26) — module
pip
Install with pip install ansible==2.9.26
Create/Delete/Initialize SnapMirror volume/vserver relationships for ONTAP/ONTAP
Create/Delete/Initialize SnapMirror volume relationship between ElementSW and ONTAP
Modify schedule for a SnapMirror relationship for ONTAP/ONTAP and ElementSW/ONTAP
Pre-requisite for ElementSW to ONTAP relationship or vice-versa is an established SnapMirror endpoint for ONTAP cluster with ElementSW UI
Pre-requisite for ElementSW to ONTAP relationship or vice-versa is to have SnapMirror enabled in the ElementSW volume
For creating a SnapMirror ElementSW/ONTAP relationship, an existing ONTAP/ElementSW relationship should be present
# creates and initializes the snapmirror - name: Create ONTAP/ONTAP SnapMirror na_ontap_snapmirror: state: present source_volume: test_src destination_volume: test_dest source_vserver: ansible_src destination_vserver: ansible_dest schedule: hourly policy: MirrorAllSnapshots max_transfer_rate: 1000 hostname: "{{ destination_cluster_hostname }}" username: "{{ destination_cluster_username }}" password: "{{ destination_cluster_password }}"
# creates and initializes the snapmirror between vservers - name: Create ONTAP/ONTAP vserver SnapMirror na_ontap_snapmirror: state: present source_vserver: ansible_src destination_vserver: ansible_dest identity_preserve: true hostname: "{{ destination_cluster_hostname }}" username: "{{ destination_cluster_username }}" password: "{{ destination_cluster_password }}"
# existing snapmirror relation with status 'snapmirrored' will be initialized - name: Initialize ONTAP/ONTAP SnapMirror na_ontap_snapmirror: state: present source_path: 'ansible:test' destination_path: 'ansible:dest' hostname: "{{ destination_cluster_hostname }}" username: "{{ destination_cluster_username }}" password: "{{ destination_cluster_password }}"
- name: Delete SnapMirror na_ontap_snapmirror: state: absent destination_path: <path> source_hostname: "{{ source_hostname }}" hostname: "{{ destination_cluster_hostname }}" username: "{{ destination_cluster_username }}" password: "{{ destination_cluster_password }}"
- name: Set schedule to NULL na_ontap_snapmirror: state: present destination_path: <path> schedule: "" hostname: "{{ destination_cluster_hostname }}" username: "{{ destination_cluster_username }}" password: "{{ destination_cluster_password }}"
- name: Create SnapMirror from ElementSW to ONTAP na_ontap_snapmirror: state: present connection_type: elementsw_ontap source_path: '10.10.10.10:/lun/300' destination_path: 'ansible_test:ansible_dest_vol' schedule: hourly policy: MirrorLatest hostname: "{{ netapp_hostname }}" username: "{{ netapp_username }}" password: "{{ netapp_password }}" source_hostname: " {{ Element_cluster_mvip }}" source_username: "{{ Element_cluster_username }}" source_password: "{{ Element_cluster_password }}"
- name: Create SnapMirror from ONTAP to ElementSW na_ontap_snapmirror: state: present connection_type: ontap_elementsw destination_path: '10.10.10.10:/lun/300' source_path: 'ansible_test:ansible_dest_vol' policy: MirrorLatest hostname: "{{ Element_cluster_mvip }}" username: "{{ Element_cluster_username }}" password: "{{ Element_cluster_password }}" source_hostname: " {{ netapp_hostname }}" source_username: "{{ netapp_username }}" source_password: "{{ netapp_password }}"
https: default: false description: - Enable and disable https. - Ignored when using REST as only https is supported. - Ignored when using SSL certificate authentication as it requires SSL. type: bool state: choices: - present - absent default: present description: - Whether the specified relationship should exist or not. ontapi: description: - The ontap api version to use type: int policy: description: - Specify the name of the SnapMirror policy that applies to this relationship. version_added: '2.8' version_added_collection: ansible.builtin hostname: description: - The hostname or IP address of the ONTAP instance. required: true type: str password: aliases: - pass description: - Password for the specified user. type: str schedule: description: - Specify the name of the current schedule, which is used to update the SnapMirror relationship. - Optional for create, modifiable. use_rest: choices: - Never - Always - Auto default: Auto description: - REST API if supported by the target system for all the resources and attributes the module requires. Otherwise will revert to ZAPI. - Always -- will always use the REST API - Never -- will always use the ZAPI - Auto -- will try to use the REST Api type: str username: aliases: - user description: - This can be a Cluster-scoped or SVM-scoped account, depending on whether a Cluster-level or SVM-level API is required. - For more information, please read the documentation U(https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/). - Two authentication methods are supported - 1. basic authentication, using username and password, - 2. SSL certificate authentication, using a ssl client cert file, and optionally a private key file. - To use a certificate, the certificate must have been installed in the ONTAP cluster, and cert authentication must have been enabled. type: str http_port: description: - Override the default port (80 or 443) with this port type: int source_path: description: - Specifies the source endpoint of the SnapMirror relationship. - If the source is an ONTAP volume, format should be <[vserver:][volume]> or <[[cluster:]//vserver/]volume> - If the source is an ElementSW volume, format should be <[Element_SVIP]:/lun/[Element_VOLUME_ID]> - If the source is an ElementSW volume, the volume should have SnapMirror enabled. key_filepath: description: - path to SSL client key file. type: str version_added: 20.6.0 version_added_collection: netapp.ontap cert_filepath: description: - path to SSL client cert file (.pem). - not supported with python 2.6. type: str version_added: 20.6.0 version_added_collection: netapp.ontap feature_flags: description: - Enable or disable a new feature. - This can be used to enable an experimental feature or disable a new feature that breaks backward compatibility. - Supported keys and values are subject to change without notice. Unknown keys are ignored. type: dict version_added: 20.5.0 version_added_collection: netapp.ontap source_volume: description: - Specifies the name of the source volume for the SnapMirror. source_vserver: description: - Name of the source vserver for the SnapMirror. validate_certs: default: true description: - If set to C(no), the SSL certificates will not be validated. - This should only set to C(False) used on personally controlled sites using self-signed certificates. type: bool connection_type: choices: - ontap_ontap - elementsw_ontap - ontap_elementsw default: ontap_ontap description: - Type of SnapMirror relationship. - Pre-requisite for either elementsw_ontap or ontap_elementsw the ElementSW volume should have enableSnapmirror option set to true. - For using ontap_elementsw, elementsw_ontap snapmirror relationship should exist. version_added: '2.9' version_added_collection: ansible.builtin source_hostname: description: - Source hostname or management IP address for ONTAP or ElementSW cluster. - Required for SnapMirror delete source_password: description: - Source password for ONTAP or ElementSW cluster. - Optional if this is same as destination password. source_username: description: - Source username for ONTAP or ElementSW cluster. - Optional if this is same as destination username. destination_path: description: - Specifies the destination endpoint of the SnapMirror relationship. identity_preserve: description: - Specifies whether or not the identity of the source Vserver is replicated to the destination Vserver. - If this parameter is set to true, the source Vserver's configuration will additionally be replicated to the destination. - If the parameter is set to false, then only the source Vserver's volumes and RBAC configuration are replicated to the destination. type: bool version_added: '2.9' version_added_collection: ansible.builtin max_transfer_rate: description: - Specifies the upper bound, in kilobytes per second, at which data is transferred. - Default is unlimited, it can be explicitly set to 0 as unlimited. type: int version_added: '2.9' version_added_collection: ansible.builtin relationship_type: choices: - data_protection - load_sharing - vault - restore - transition_data_protection - extended_data_protection description: - Specify the type of SnapMirror relationship. destination_volume: description: - Specifies the name of the destination volume for the SnapMirror. destination_vserver: description: - Name of the destination vserver for the SnapMirror.