Skip to main content
A newer release of this product is available.

snapmirror create

Contributors
Suggest changes

Create a new SnapMirror relationship

Availability: This command is available to cluster and Vserver administrators at the admin privilege level.

Description

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 non-FlexGroup 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 subtypedefault and the destination Vserver of subtypedp-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" .

Note SnapMirror relationships, except load-sharing relationships, which are created between two volumes which are both on a storage system running Data ONTAP version 8.2 and later have the "Relationship Capability" field set to "8.2 and above" .

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.

Parameters

{ -S, -source-path {<[vserver:][volume]>|<[[cluster:]//vserver/]volume>|<hostip:/lun/name>|<hostip:/share/share-name>|<[vserver:]/cg/[cgname]>} - Source Path

This parameter specifies the source endpoint of the SnapMirror relationship in one of four path formats. The normal format includes the names of the Vserver (vserver) and/or the volume (volume). To support relationships with "Relationship Capability" of "Pre 8.2" , a format which also includes the name of the cluster (cluster) is provided. The "Pre 8.2" format cannot be used when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" . For SnapMirror relationships with an AltaVault source, the source endpoint is specified in the form hostip:/share/share-name . For SnapMirror relationships with a SolidFire source, the source endpoint is specified in the form hostip:/lun/name .

| [-source-cluster <Cluster name>] - Source Cluster

Specifies the source cluster of the SnapMirror relationship. If this parameter is specified, the -source-vserver and -source-volume parameters must also be specified. This parameter is only applicable for relationships with "Relationship Capability" of "Pre 8.2" . This parameter cannot be specified when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" .

-source-vserver <vserver name> - Source Vserver

Specifies the source Vserver of the SnapMirror relationship. For relationships with volumes as endpoints, if this parameter is specified, parameters -source-volume and for relationships with "Relationship Capability" of "Pre 8.2" , -source-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP source endpoints.

[-source-volume <volume name>] - Source Volume }

Specifies the source volume of the SnapMirror relationship. If this parameter is specified, parameters -source-vserver and for relationships with "Relationship Capability" of "Pre 8.2" , -source-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP source endpoints.

{ -destination-path {<[vserver:][volume]>|<[[cluster:]//vserver/]volume>|<hostip:/lun/name>|<hostip:/share/share-name>|<[vserver:]/cg/[cgname]>} - Destination Path

This parameter specifies the destination endpoint of the SnapMirror relationship in one of four path formats. The normal format includes the names of the Vserver (vserver) and/or volume (volume). To support relationships with "Relationship Capability" of "Pre 8.2" , a format which also includes the name of the cluster (cluster) is provided. The "Pre 8.2" format cannot be used when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" . For SnapMirror relationships with AltaVault destinations, the destination endpoint is specified in the form hostip:/share/share-name . For relationships with SolidFire destinations, the destination endpoint is specified in the form hostip:/lun/name .

| [-destination-cluster <Cluster name>] - Destination Cluster

Specifies the destination cluster of the SnapMirror relationship. If this parameter is specified, parameters -destination-vserver and -destination-volume must also be specified. This parameter is only applicable for relationships with "Relationship Capability" of "Pre 8.2" . This parameter cannot be specified when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" .

-destination-vserver <vserver name> - Destination Vserver

Specifies the destination Vserver of the SnapMirror relationship. For relationships with volumes as endpoints, if this parameter is specified, parameters -destination-volume and for relationships with "Relationship Capability" of "Pre 8.2" , -destination-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP destination endpoints.

-destination-volume <volume name> - Destination Volume }

Specifies the destination volume of the SnapMirror relationship. If this parameter is specified, parameters -destination-vserver and for relationships with "Relationship Capability" of "Pre 8.2" , -destination-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP destination endpoints.

[-type <snapmirrorType>] - Relationship Type

This parameter specifies the type of SnapMirror relationship that will be created. You can create a data protection (DP) relationship (to be deprecated in subsequent releases), an extended data protection (XDP) relationship, a transition data protection relationship between a Data ONTAP operating in 7-Mode system and a clustered Data ONTAP system (TDP), or a load-sharing (LS) relationship. The default value is XDP for all relationships except for Vserver DR relationships. FlexGroup volumes and non-Data ONTAP endpoints support only XDP relationships. For FlexVol volume relationships, when DP is specified as the type, an XDP relationship will be created unless a relationship of type DP in the opposite direction already exists. In that case the new relationship will be of type DP.

[-vserver <vserver name>] - Managing Vserver

If this optional parameter is specified, it designates the managing Vserver. The managing Vserver is authorized to use SnapMirror commands to manage the SnapMirror relationship. The -vserver parameter is currently a reserved parameter.

[-schedule <text>] - SnapMirror Schedule

This optional parameter designates the name of the schedule which is used to update the SnapMirror relationship. If you do not designate a schedule, updates are not scheduled, so you must update the SnapMirror relationship manually using the snapmirror update command or, in the case of a set of load-sharing mirrors, using the snapmirror update-ls-set command.

Note You define and name a schedule using the job schedule cron create command.
[-policy <sm_policy>] - SnapMirror Policy

This optional parameter designates the name of the SnapMirror policy which is associated with the SnapMirror relationship. For FlexVol volume relationships, the default policy when the data protection (DP) type is specified is MirrorAllSnapshots and the default policy when no type is specified or when the extended data protection (XDP) type is specified is MirrorAndVault . For FlexGroup volume relationships, the MirrorAndVault policy is applied. For SnapMirror relationships between SnapLock volumes, if no policy is specified the default policy MirrorAllSnapshots is applied. For relationships with a SolidFire endpoint, there is no default policy. For these relationships a policy as described below must be specified. This parameter is not applicable to relationships with "Relationship Capability" of "Pre 8.2" .

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.

Note You define and name a policy using the snapmirror policy create command.
[-tries <unsigned32_or_unlimited>] - Tries Limit

This optional parameter specifies the maximum number of times to attempt each manual or scheduled transfer for a SnapMirror relationship. The default is eight times. The -tries parameter can be set to 0 to disable manual and scheduled updates for the SnapMirror relationship. This parameter is only applicable to relationships with "Relationship Capability" of "Pre 8.2" . For relationships with "8.2 and above" capability, the tries limit is controlled by the value of tries in the SnapMirror policy that is associated with the relationship.

[-k, -throttle <throttleType>] - Throttle (KB/sec)

This optional parameter limits the network bandwidth used for transfers. It configures for the relationship the maximum rate (in Kbytes/sec) at which data can be transferred. If no throttle is configured, by default the SnapMirror relationship fully utilizes the network bandwidth available. You can also configure the relationship to fully use the network bandwidth available by explicitly setting the throttle to unlimited or 0 . The minimum effective throttle value is four Kbytes/sec, so if you specify a throttle value between 1 and 4 , it will be treated as 4 . For FlexGroup volume relationships, the throttle value is applied individually to each constituent relationship. The -throttle parameter does not affect load-sharing mirrors and other SnapMirror relationships with "Relationship Capability" of "Pre 8.2" confined to a single cluster.

[-cg-item-mappings {<source volume>:@<destination volume>|<source item path>:@<destination item path>}] - Consistency Group Item Mappings

This optional parameter specifies a list of the consistency group (CG) item mappings. It is considered only if the supplied source and destination path values denote valid CG paths. For CG level relationships, this parameter must be specified. The value for this parameter must contain mappings of one or more pairs of constituent source and destination volumes of the form srcvol1:@dstvol1,…​ .

[-identity-preserve {true|false}] - Identity Preserve Vserver DR

Specifies whether or not the identity of the source Vserver is replicated to the destination Vserver of the Vserver SnapMirror relationship that will be created. 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. This parameter is applicable only for SnapMirror relationships with Vserver endpoints. The default value is false.

[-is-auto-expand-enabled {true|false}] - Is Auto Expand Enabled

This optional parameter specifies whether or not a FlexGroup SnapMirror relationship and its destination FlexGroup volume should be auto-expanded if the source FlexGroup volume is expanded. This parameter is supported only for FlexGroup SnapMirror relationships. The default value is true.

Examples

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/vs1_root which is a Vserver root volume, and the destination endpoint cluster1://vs1.example.com/vs1_root_ls1 with the schedule named 5min used to update the relationship, type the following command:

cluster1::> snapmirror create
       -destination-path cluster1://vs1.example.com/vs1_root_ls1
       -source-path      cluster1://vs1.example.com/vs1_root -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

To create an SMBC relationship with the following attributes:

  • It is between the source Consistency Group cg_src in Vserver vs1.example.com , and the destination Consistency Group cg_dst in Vserver vs2.example.com .

  • It has item mappings between volumes srcvol1 and srcvol2 and volumes dstvol1 and dstvol2 .

  • It uses the default policy named AutomatedFailOver that has a policy type of automated-failover .

Type the following command from the destination cluster:

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