Create a new SnapMirror relationship
The snapmirror create command creates a SnapMirror relationship between a source and destination endpoint. You can use this command to create a data protection relationship, an extended data protection relationship, or a load-sharing relationship between FlexVol volumes. You can also use it to create a data protection relationship between Vservers. A SnapMirror relationship between Vservers can only be created if the system containing the source Vserver is also running Data ONTAP 8.3 or later. You can also use the snapmirror create command to create an extended data protection relationship between FlexGroups. FlexGroups only support extended data protection relationships. A SnapMirror relationship between FlexGroups is only supported if the system containing the source FlexGroup volume is also running Data ONTAP 9.1.0 or later. The source or destination of a FlexGroup SnapMirror relationship cannot be the source or destination of any other SnapMirror relationship.
You can use the snapmirror create command to create a data protection relationship or an extended data protection relationship between SnapLock source and SnapLock destination endpoints. When the cluster containing the source is running ONTAP 9.5.0 or later, the default relationship type is extended data protection (XDP), otherwise it is data protection (DP).
A SnapMirror relationship can also be created between a non-SnapLock source and a SnapLock destination to WORM-protect Snapshot copies. In this case, the relationship type is always set to extended data protection (XDP).
The snapmirror create command can be used to create an extended data protection (XDP) relationship between a Data ONTAP volume and a non-Data ONTAP endpoint that supports SnapMirror (AltaVault, Solidfire). AltaVault endpoints can only be used as destinations. SolidFire endpoints can be used as sources or destinations.
The snapmirror create command can be used to create a synchronous relationship between FlexVol volumes, which provides zero Recovery Point Objective (RPO) data protection. SnapMirror Synchronous supports two policy types, sync-mirror and strict-sync-mirror. Upon a permanent replication failure, the strict-sync-mirror variant restricts further client IO on the primary, whereas the sync-mirror variant does not.
The snapmirror create command can be used to create a SnapMirror Business Continuity (SMBC) relationship between Consistency Groups that have FlexVol volumes as items. This provides zero RPO and zero Recovery Time Objective (RTO) data protection, also known as transparent application failover, for SAN workloads. An SMBC relationship supports the automated-failover policy type and can only be created when the systems containing the source items and the destination items are running ONTAP 9.9.1 or later.
Before using this command to create a SnapMirror relationship between Vservers, you typically create a source and destination Vserver using the vserver create command. The source Vserver should be of subtype default and the destination Vserver of subtype dp-destination. Also, before creating the relationship between Vservers, you must setup Vserver peer by using the vserver peer create command between the source and destination Vservers. A Vserver relationship cannot be created between two Vservers within the same cluster. The root volume of the destination Vserver will be read-write and data from the source Vserver's root volume will not be replicated. Therefore there will be no volume level relationship created between the root volumes of the two Vservers.
After creating the relationship, the destination Vserver must be initialized by using the snapmirror initialize command.
Before using this command to create a volume SnapMirror relationship, you typically create a source and destination volume using the volume create command. The source volume should be in the online state and a read-write (RW) type. The destination volume should be in the online state and a data protection (DP) type. For FlexGroup SnapMirror relationships, the source and destination FlexGroups must be spread over the same number of aggregates as specified in the -aggr-list parameter with the same number of constituents per aggregate as specified in the -aggr-list-multiplier parameter of the volume create command.
When a FlexGroup SnapMirror relationship is created, normally hidden relationships are also created for the constituent volumes. These relationships can be seen by using the -expand parameter of the snapmirror show command. Source information for these relationships can be seen using the -expand parameter of the snapmirror list-destinations command. Other SnapMirror commands are disabled for FlexGroup constituent relationships and FlexGroup constituent volumes.
If all systems involved are running Data ONTAP version 8.2 and later, a Vserver peering relationship must be set up using the vserver peer create command between the source and the destination Vservers to create a relationship between the source and destination volumes. To enable interoperability with Data ONTAP 8.1, if the source volume is on a storage system running clustered Data ONTAP 8.1, the cluster administrator can create a data protection relationship between the source and destination volumes without a Vserver peering relationship between the source and destination Vservers. These relationships are managed the same way as on Data ONTAP 8.1 and the "Relationship Capability" field, as shown in the output of the snapmirror show command, is set to "Pre 8.2".
Load-sharing mirrors must be confined to a single Vserver; they are not allowed to span Vservers. Load-sharing relationships are created with the "Relationship Capability" field set to "Pre 8.2" even if both the source and destination volumes are on a storage system running Data ONTAP version 8.2 and later. There is no "8.2 and above" implementation for load-sharing relationships.
A set of load-sharing mirrors can have one or more destination volumes. You create separate SnapMirror relationships between the common source volume and each destination volume to create the set of load-sharing mirrors.
The source or destination of a load-sharing relationship cannot be the source or destination of any other SnapMirror relationship.
After creating the relationship, the destination volume can be initialized using the snapmirror initialize command. The destination volumes in a set of load-sharing mirrors are initialized using the snapmirror initialize-ls-set command.
The snapmirror create command must be used from the destination Vserver or cluster.
In clustered Data ONTAP 8.2 data protection (DP) relationships were used for mirroring, while extended data protection (XDP) relationships were used for vaulting. In clustered Data ONTAP 8.3 extended data protection (XDP) relationships support two more use cases, mirroring and unified mirror-vault. The exact behavior of an extended data protection (XDP) relationship is governed by the snapmirror policy associated with that relationship. In clustered Data ONTAP 8.3 the snapmirror policy has a new field type to indicate how the relationships with that policy will behave. The supported types are async-mirror (mirroring), vault (vaulting) and mirror-vault (unified mirroring and vault). For XDP relationships between a Data ONTAP source volume and an AltaVault destination endpoint, only policies of type vault are supported. For XDP relationships between a Data ONTAP source volume and a SolidFire destination endpoint, only policies of type async-mirror without an all_source_snapshots rule are supported. For XDP relationships between a SolidFire source endpoint and a Data ONTAP destination volume, only policies of type async-mirror without an all_source_snapshots rule, and policies of type mirror-vault are supported. SnapMirror policies of type async-mirror associated with FlexVol volume relationships when relationship type DP is specified or when no relationship type is specified, must include the label all_source_snapshots. Refer to the man page for the snapmirror policy create command for more information.
To create an extended data protection relationship between the source endpoint vs1.example.com:dept_eng, and the destination endpoint vs2.example.com:dept_eng_dp_mirror2, with the default policy of MirrorAndVault, type the following command:
vs2.example.com::> snapmirror create -destination-path vs2.example.com:dept_eng_dp_mirror2 -source-path vs1.example.com:dept_eng
To create an extended data protection relationship between the source FlexGroup vs1.example.com:fg_src and the destination FlexGroup vs2.example.com:fg_dst, with the default policy of MirrorAndVault, type the following command:
vs2.example.com::> snapmirror create -destination-path vs2.example.com:fg_dst -source-path vs1.example.com:fg_src
To create a synchronous SnapMirror relationship between the source Flexvol vs1.example.com:vol_log, and the destination Flexvol vs2.example.com:vol_log_sync_dp when the source cluster is running ONTAP 9.5 or above, type the following command:
vs2.example.com::> snapmirror create -destination-path vs2.example.com:vol_log_sync_dp -source-path vs1.example.com:vol_log -policy Sync
To create a strict synchronous SnapMirror relationship between the source Flexvol vs1.example.com:vol_log, and the destination Flexvol vs2.example.com:vol_log_sync_dp when the source cluster is running ONTAP 9.5 or above, type the following command:
vs2.example.com::> snapmirror create -destination-path vs2.example.com:vol_log_sync_dp -source-path vs1.example.com:vol_log -policy StrictSync
To create a data protection mirror between the source endpoint cluster1://vs1.example.com/dept_eng, and the destination endpoint cluster2://vs2.example.com/dept_eng_dp_mirror2 when the source cluster is running Data ONTAP 8.1 software, type the following command:
cluster2::> snapmirror create -destination-path cluster2://vs2.example.com/dept_eng_dp_mirror2 -source-path cluster1://vs1.example.com/dept_eng -type DP
To create a load-sharing mirror between the source endpoint cluster1://vs1.example.com/mkt1, and the destination endpoint cluster1://vs1.example.com/mkt1_ls1 with the schedule named 5min used to update the relationship, type the following command:
cluster1::> snapmirror create -destination-path cluster1://vs1.example.com/mkt1_ls1 -source-path cluster1://vs1.example.com/mkt1 -type LS -schedule 5min
To create a SnapMirror relationship between the source Vserver vs1.example.com, and the destination Vserver dvs1.example.com with the schedule named hourly used to update the relationship, type the following command:
cluster2::> snapmirror create -destination-path dvs1.example.com: -source-path vs1.example.com: -schedule hourly
To create an extended data protection (XDP) relationship between the Data ONTAP source endpoint vs1.example.com:data_ontap_vol, and the AltaVault destination endpoint 10.0.0.11:/share/share1, type the following command:
vs1.example.com::> snapmirror create -destination-path 10.0.0.11:/share/share1 -source-path vs1.example.com:data_ontap_vol -type XDP
To create an extended data protection (XDP) relationship between the SolidFire source endpoint 10.0.0.12:/lun/0001, and the Data ONTAP destination endpoint vs2.example.com:data_ontap_vol2, type the following command:
vs2.example.com::> snapmirror create -source-path 10.0.0.12:/lun/0001 -destination-path vs2.example.com:data_ontap_vol2 -type XDP -policy MirrorLatest
vs2.example.com::> snapmirror create -destination-path vs2.example.com:/cg/cg_dst -source-path vs1.example.com:/cg/cg_src -type XDP -policy SmgrSync -cg-item-mappings /vol/srcvol/lun1:@/vol/dstvol/lun1, /vol/srcvol/lun2:@/vol/dstvol/lun2
Under PVR control to create a new item mapping between lun3 on volume srcvol and lun3 on volume dstvol in the existing SnapMirror synchronous Consistency Group relationship that was created above, type the following command:
vs2.example.com::> snapmirror create -destination-path vs2.example.com:/cg/cg_dst -source-path vs1.example.com:/cg/cg_src -type XDP -policy SmgrSync -cg-item-mappings /vol/srcvol/lun3:@/vol/detvol/lun3
destination::> snapmirror create -destination-path vs2.example.com:/cg/cg_dst -source-path vs1.example.com:/cg/cg_src -cg-item-mappings srcvol1:@dstvol1,srcvol2:@dstvol2