Create a custom replication policy

Contributors

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 starting with ONTAP 9.5)

sync-mirror

SnapMirror Synchronous in the Sync mode (supported starting 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.

Step
  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.

    Starting 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.