NetApp ONTAP SnapMirror Create: DR, SnapVault and Sync Policies - 夜莺博客

NetApp ONTAP SnapMirror Create: DR, SnapVault and Sync Policies

SnapMirror is NetApp ONTAP's replication engine, and in modern ONTAP releases one command family - snapmirror create - covers all relationship types: SnapMirror DR (disaster recovery), SnapVault (backup with longer retention) and unified replication that combines both. This article walks through the official NetApp procedure: creating the destination volume, choosing the right type and policy, initializing the relationship and verifying it - all from the cluster CLI.

Understand Type and Policy First

  • Type DP - classic data protection volume (read-only until failover); ONTAP converts it to XDP automatically in recent releases when no policy is specified.
  • Type XDP - extended data protection with policy-based schedules and snapshots (the default in ONTAP 9.12+).
  • Policies - MirrorLatest (DR), XDPDefault (SnapVault), MirrorAndVault (unified) and Sync/StrictSync for synchronous replication.

Step 1: Create the Destination Volume

The destination volume must be at least as large as the source. Create it from the destination cluster with -type DP so ONTAP marks it as a replication target:

cluster_dst::> volume create -vserver svm_dr -volume volA_dst -aggregate node01_aggr -type DP -size 2GB

Alternatively, let SnapMirror auto-create the destination: if you specify the correct SVM and volume name in snapmirror create and the volume does not exist, ONTAP creates it.

Step 2: Create the Relationship from the Destination

cluster_dst::> snapmirror create -source-path svm1:volA -destination-path svm_backup:volA_dst -type XDP -schedule my_daily -policy MirrorLatest

Examples for other scenarios:

# SnapVault with longer retention
cluster_dst::> snapmirror create -source-path svm1:volA -destination-path svm_backup:volA_dst -type XDP -schedule my_daily -policy XDPDefault

# Unified (mirror + vault)
cluster_dst::> snapmirror create -source-path svm1:volA -destination-path svm_backup:volA_dst -type XDP -schedule my_daily -policy MirrorAndVault

# Synchronous replication
cluster_dst::> snapmirror create -source-path svm1:volA -destination-path svm_backup:volA_dst -type XDP -policy Sync

Always create relationships from the destination cluster - this is the ONTAP convention and avoids source-side permission errors.

Step 3: Initialize and Verify

cluster_dst::> snapmirror initialize -destination-path svm_dr:volA_dst
cluster_dst::> snapmirror show -destination-path svm_dr:volA_dst

snapmirror show confirms the relationship state and the transfer progress. Common errors and their fixes:

  • Relationship already exists - check with snapmirror show -destination-path ...; the relationship may already be active.
  • Source volume ... not found - verify the SVM and volume names on the source with volume show -vserver svm_prod.
  • Destination volume does not exist - create the destination volume first (or check the SVM name in your destination path).

Related Reading on This Site

See the SnapMirror setup, monitoring and troubleshooting guide and the NetApp ONTAP CLI cheat sheet for surrounding commands.

原文链接:https://docs.netapp.com/us-en/ontap/data-protection/create-replication-relationship-task.html