Skip to main content

snapmirror policy create

Suggest changes

Create a new SnapMirror policy

Availability: This command is available to cluster and Vserver administrators at the admin privilege level.


The snapmirror policy create command creates a SnapMirror policy. When applied to a SnapMirror relationship, the SnapMirror policy controls the behavior of the relationship and specifies the configuration attributes for that relationship. The policies DPDefault , MirrorAllSnapshots , MirrorAndVault , MirrorLatest , Unified7year and XDPDefault are created by the system.

Note All SnapMirror policies have a field create-snapshot . This field specifies whether SnapMirror creates a new Snapshot copy on the primary volume at the beginning of a snapmirror update or snapmirror resync operation. Currently this field cannot be set or modified by the user. It is set to true for SnapMirror policies of type async-mirror and mirror-vault at the time of creation. SnapMirror policies of type vault have create-snapshot set to false at the time of creation.
Note Use the snapmirror policy add-rule command to add a rule to a policy.


-vserver <vserver name> - Vserver Name

Specifies the Vserver for the SnapMirror policy.

-policy <sm_policy> - SnapMirror Policy Name

This parameter specifies the SnapMirror policy name. A policy name can be made up of the characters A to Z, a to z, 0 to 9, ".", "-", and "_". The name can be up to 256 characters in length.

[-type {vault|async-mirror|mirror-vault}] - Snapmirror Policy Type

This parameter specifies the SnapMirror policy type. The supported values are async-mirror , vault and mirror-vault . Data protection (DP) relationships support only async-mirror policy type, while extended data protection (XDP) relationships support all three policy types.

If the type is set to async-mirror then the policy is for Disaster Recovery. When the policy type is associated with extended data protection (XDP) relationships, snapmirror update and snapmirror resync operations transfer selected Snapshot copies from the primary volume to the secondary volume. The selection of Snapshot copies is governed by the rules in the policy. However snapmirror initialize and snapmirror update operations on data protection (DP) relationships ignore the rules in the policy and transfer all Snapshot copies of the primary volume which are newer than the common Snapshot copy on the destination. For both data protection (DP) and extended data protection (XDP) relationships, the Snapshot copies are kept on the secondary volume as long as they exist on the primary volume. Once a protected Snapshot copy is deleted from the primary volume, it is deleted from the secondary volume as part of the next transfer. The policy type supports rules with certain pre-defined label names only. Refer to the man page for the snapmirror policy add-rule command for the details.

If the type is set to vault then the policy is used for Backup and Archive. The rules in this policy type determine which Snapshot copies are protected and how long they are retained on the secondary volume. This policy type is supported by extended data protection (XDP) relationships only.

If the type is set to mirror-vault then the policy is used for unified data protection which provides both Disaster Recovery and Backup using the same secondary volume. This policy type is supported by extended data protection (XDP) relationships only.

[-comment <text>] - Comment

Specifies a text comment for the SnapMirror policy. If the comment contains spaces, it must be enclosed within quotes.

[-tries <unsigned32_or_unlimited>] - Tries Limit

Determines the maximum number of times to attempt each manual or scheduled transfer for a SnapMirror relationship. The value of this parameter must be a positive integer or unlimited . The default value is 8 .

[-transfer-priority {low|normal}] - Transfer Scheduling Priority

Specifies the priority at which a transfer runs. The supported values are normal or low . The normal transfers are scheduled before the low priority transfers. The default is normal .

[-ignore-atime {true|false}] - Ignore File Access Time

This parameter applies only to extended data protection (XDP) relationships. It specifies whether incremental transfers will ignore files which have only their access time changed. The supported values are true or false . The default is false .

[-restart {always|never|default}] - Restart Behavior

This parameter applies only to data protection relationships. It defines the behavior of SnapMirror if an interrupted transfer exists. The supported values are always , never , or default . If the value is set to always , an interrupted SnapMirror transfer always restarts provided it has a restart checkpoint and the conditions are the same as they were before the transfer was interrupted. In addition, a new SnapMirror Snapshot copy is created which will then be transferred. If the value is set to never , an interrupted SnapMirror transfer will never restart, even if a restart checkpoint exists. A new SnapMirror Snapshot copy will still be created and transferred. Data ONTAP version 8.2 will interpret a value of default as being the same as always . Vault transfers will always resume based on a restart checkpoint, provided the Snapshot copy still exists on the source volume.

[-is-network-compression-enabled {true|false}] - Is Network Compression Enabled

Specifies whether network compression is enabled for transfers. The supported values are true or false . The default is false .

[-discard-configs <network>,…​] - Configurations Not Replicated During Identity Preserve Vserver DR

Specifies the configuration to be dropped during replication. The supported values are:

  • network - Drops network interfaces, routes, and kerberos configuration.

This parameter is supported only for policies of type async-mirror and applicable only for identity-preserve Vserver SnapMirror relationships.


The following example creates a SnapMirror policy named TieredBackup on a Vserver named .> snapmirror policy create -vserver
       -policy TieredBackup -type vault -tries 10 -restart never