Configuring a replication relationship in one step

Starting in ONTAP 9.3, you can use the snapmirror protect command to configure a data protection relationship in a single step. You specify a list of volumes to be replicated, an SVM on the destination cluster, a job schedule, and a SnapMirror policy. snapmirror protect does the rest.

Before you begin

About this task

The snapmirror protect command chooses an aggregate associated with the specified SVM. If no aggregate is associated with the SVM, it chooses from all the aggregates in the cluster. The choice of aggregate is based on the amount of free space and the number of volumes on the aggregate.

The snapmirror protect command then performs the following steps:

The name of the destination volume is of the form source_volume_name_dst. In case of a conflict with an existing name, the command appends a number to the volume name. You can specify a prefix and/or suffix in the command options. The suffix replaces the system-supplied dst suffix.

In ONTAP 9.3 and earlier, a destination volume can contain up to 251 Snapshot copies. In ONTAP 9.4 and later, a destination volume can contain up to 1019 Snapshot copies.

Note: Initialization can be time-consuming. snapmirror protect does not wait for initialization to complete before the job finishes. For this reason, you should use the snapmirror show command rather than the job show command to determine when initialization is complete.

Starting with ONTAP 9.5, SnapMirror Synchronous relationships can be created by using the snapmirror protect command.

Step

  1. Create and initialize a replication relationship in one step:snapmirror protect -path-list SVM:volume|cluster://SVM/volume, ... -destination-vserver destination_SVM -policy policy -schedule schedule -auto-initialize true|false -destination-volume-prefix prefix -destination-volume-suffix suffix
    Note: You must run this command from the destination SVM or the destination cluster. The -auto-initialize option defaults to "true".
    Example
    The following example creates and initializes a SnapMirror DR relationship using the default MirrorAllSnapshots policy:
    cluster_dst::> snapmirror protect -path-list svm1:volA, svm1:volB -destination-vserver svm_backup -policy MirrorAllSnapshots -schedule replication_daily
    Note: You can use a custom policy if you prefer. For more information, see Creating a custom replication policy.
    Example
    The following example creates and initializes a SnapVault relationship using the default XDPDefault policy:
    cluster_dst::> snapmirror protect -path-list svm1:volA, svm1:volB -destination-vserver svm_backup -policy XDPDefault -schedule replication_daily
    Example
    The following example creates and initializes a unified replication relationship using the default MirrorAndVault policy:
    cluster_dst::> snapmirror protect -path-list svm1:volA, svm1:volB -destination-vserver svm_backup -policy MirrorAndVault
    Example
    The following example creates and initializes a SnapMirror Synchronous relationship using the default Sync policy:
    cluster_dst::> snapmirror protect -path-list svm1:volA, svm1:volB -destination-vserver svm_sync -policy Sync
    Note: For SnapVault and unified replication policies, you might find it useful to define a schedule for creating a copy of the last transferred Snapshot copy on the destination. For more information, see Defining a schedule for creating a local copy on the destination.

After you finish

Use the snapmirror show command to verify that the SnapMirror relationship was created. For complete command syntax, see the man page.