Skip to main content

Create a custom replication policy

Contributors netapp-lenida netapp-thomi

You can create a custom replication policy if the default policy for a relationship is not suitable. You might want to compress data in a network transfer, for example, or modify the number of attempts SnapMirror makes to transfer Snapshot copies.

You can use a default or custom policy when you create a replication relationship. For a custom archive (formerly SnapVault) or unified replication policy, you must define one or more rules that determine which Snapshot copies are transferred during initialization and update. You might also want to define a schedule for creating local Snapshot copies on the destination.

The policy type of the replication policy determines the type of relationship it supports. The table below shows the available policy types.

Policy type

Relationship type

async-mirror

SnapMirror DR

vault

SnapVault

mirror-vault

Unified replication

strict-sync-mirror

SnapMirror synchronous in the StrictSync mode (supported beginning with ONTAP 9.5)

sync-mirror

SnapMirror synchronous in the Sync mode (supported beginning with ONTAP 9.5)

Tip

When you create a custom replication policy, it is a good idea to model the policy after a default policy.

Steps

You can create custom data protection policies with System Manager or the ONTAP CLI. Beginning with ONTAP 9.11.1, you can use System Manager to create custom mirror and vault policies, and to display and select legacy policies. This capability is also available in ONTAP 9.8P12 and later patches of ONTAP 9.8.

Create custom protection policies on both the source and destination cluster.

System Manager
  1. Click Protection > Overview > Local Policy Settings.

  2. Under Protection Policies, click Arrow icon.

  3. In the Protection Policies pane, click Add icon.

  4. Enter the new policy name, and select the policy scope.

  5. Choose a policy type. To add a vault-only or mirror-only policy, choose Asynchronous, and click Use a legacy policy type.

  6. Complete the required fields.

  7. Click Save.

  8. Repeat these steps on the other cluster.

CLI
  1. Create a custom replication policy:

    snapmirror policy create -vserver <SVM> -policy _policy_ -type <async-mirror|vault|mirror-vault|strict-sync-mirror|sync-mirror> -comment <comment> -tries <transfer_tries> -transfer-priority <low|normal> -is-network-compression-enabled <true|false>

    For complete command syntax, see the man page.

    Beginning with ONTAP 9.5, you can specify the schedule for creating a common Snapshot copy schedule for SnapMirror synchronous relationships by using the -common-snapshot-schedule parameter. By default, the common Snapshot copy schedule for SnapMirror synchronous relationships is one hour. You can specify a value from 30 minutes to two hours for the Snapshot copy schedule for SnapMirror synchronous relationships.

    The following example creates a custom replication policy for SnapMirror DR that enables network compression for data transfers:

    cluster_dst::> snapmirror policy create -vserver svm1 -policy DR_compressed -type async-mirror -comment “DR with network compression enabled” -is-network-compression-enabled true

    The following example creates a custom replication policy for SnapVault:

    cluster_dst::> snapmirror policy create -vserver svm1 -policy my_snapvault -type vault

    The following example creates a custom replication policy for unified replication:

    cluster_dst::> snapmirror policy create -vserver svm1 -policy my_unified -type mirror-vault

    The following example creates a custom replication policy for SnapMirror synchronous relationship in the StrictSync mode:

    cluster_dst::> snapmirror policy create -vserver svm1 -policy my_strictsync -type strict-sync-mirror -common-snapshot-schedule my_sync_schedule
After you finish

For “vault” and “mirror-vault” policy types, you must define rules that determine which Snapshot copies are transferred during initialization and update.

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