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 Infinite Volumes and between Vservers. Infinite Volumes and Vservers support only data protection relationships. 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. Creating Vserver SnapMirror relationships is not supported for Vservers with Infinite Volumes. 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.

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.

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.

For an Infinite Volume SnapMirror relationship, the destination Infinite Volume size must be greater than or equal to the source Infinite Volume size in bytes. You can verify the size in bytes by running set`-units`KB followed by a volume show command.

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. Load sharing mirrors are not supported for Infinite Volumes.

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>} - 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>} - 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, 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 Infinite Volume and Vserver DR relationships. Infinite Volumes support only DP 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, 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.

The schedules associated with an Infinite Volume SnapMirror relationship should not have an interval shorter than hourly.

[-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 no type is specified or when the data protection (DP) type is specified is MirrorAllSnapshots and the default policy when the extended data protection (XDP) type is specified is XDPDefault . For FlexGroup volume relationships, the MirrorAllSnapshots policy 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 which 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.

[-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 MirrorAllSnapshots , 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
    -type DP

To create an extended data protection relationship between the source FlexGroup volume vs1.example.com:fg_src and the destination FlexGroup volume vs2.example.com:fg_dst , with the default policy of MirrorAllSnapshots , 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 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