Skip to main content
A newer release of this product is available.

snapmirror resync

Contributors
Suggest changes

Start a resynchronize operation

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

Description

The snapmirror resync command establishes or reestablishes a mirroring relationship between a source and a destination endpoint. The endpoints can be Vservers, volumes or non-Data ONTAP endpoints that support SnapMirror. snapmirror resync for a SnapMirror relationship with volumes as endpoints is typically executed in the following cases:

  • The destination mirror is broken (that is, the destination volume is a read-write volume and no longer a data protection mirror). After the snapmirror resync command completes, the destination volume is made a data protection mirror and the mirror can be manually updated or scheduled for updates.

  • snapmirror update command failed because the required common Snapshot copy was deleted on the source volume.

  • The volumes are the first and third endpoints in a cascade chain of relationships and they have a common Snapshot copy. In this case, snapmirror resync might implicitly create the SnapMirror relationship between them.

Note The snapmirror resync command can cause data loss on the destination volume because the command can remove the exported Snapshot copy on the destination volume.

The default behavior of the snapmirror resync command for volume relationships is defined as follows:

  • Finds the most recent common Snapshot copy between the source and destination volumes, removes Snapshot copies on the destination volume that are newer than the common Snapshot copy and mounts the destination volume as a DP volume with the common Snapshot copy as the exported Snapshot copy.

  • For data protection (DP) relationships, takes a Snapshot copy of the source volume to capture the current image and transfers Snapshot copies that are newer than the common Snapshot copy from the source volume to the destination volume. For extended data protection (XDP) relationships, transfers Snapshot copies newer than the common Snapshot copy according to the relationship policy, i.e., Snapshot copies will match rules associated with the policy as defined by the snapmirror policy commands. For relationships associated with snapmirror policy of type async-mirror and mirror-vault the snapmirror resync first takes a Snapshot copy of the source volume and includes it in the Snapshot copies selected for transfer.

  • For a SnapLock Compliance volume in an XDP relationship with SnapMirror policy of type async-mirror, if SnapMirror resync operation detects data divergence between the common Snapshot copy and the AFS on the destination volume, the resync operation preserves the data changes in a locked Snapshot copy for the duration of the current volume expiry time. If the volume expiry time is in the past or has not been set, then the Snapshot copy is locked for a duration of 30 days. The common Snapshot copy is also locked for the same duration.

For Vserver SnapMirror relationships, a resync operation is typically executed when the relationship is broken-off, the subtype of the destination Vserver is default and the destination volumes are of type read-write. Once the command is queued, the subtype of the destination Vserver changes from default to dp-destination . A successful resync operation also makes the destination Vserver's volumes data protection volumes.

If the resync command is executed on a Vserver SnapMirror relationship, and the corresponding source and destination Vservers have volumes with volume level SnapMirror relationships, then the volume level SnapMirror relationships will be converted to volumes under the Vserver SnapMirror relationship. This conversion is supported only for source and destination Vservers which have been transitioned from a 7-Mode vFiler into a C-Mode Vserver. Some basic pre-requisites for the conversion are that the destination Vserver should be in a stopped state and all the destination Vserver volumes except the root volume should be in a volume level SnapMirror relationship with volumes of the source Vserver. The state of these volume level SnapMirror relationships should be Snapmirrored and status should be Idle .

snapmirror resync for a relationship with a policy of type strict-sync-mirror or sync-mirror is typically executed in the following case:

  • The destination mirror is broken (that is, the destination volume is read-write and no longer read-only). After the snapmirror resync command completes, the destination volume changes to read-only and the relationship to InSync.

Note The snapmirror resync command is typically not required to return a relationship that has fallen out of sync due to an error condition to InSync because SnapMirror has Auto Resync for synchronous relationships. When SnapMirror detects that the relationship has fallen out of sync for any reason other than a snapmirror quiesce , snapmirror break or snapmirror delete command was exectuted on the relationship, it will automatically initiate a resync operation.

The default behavior of the snapmirror resync command for relationships with a policy of type strict-sync-mirror or sync-mirror is defined as follows:

  • Creates a Snapshot copy on the destination of the current image of the destination file system. This Snapshot copy becomes the exported Snapshot copy for the volume during the resync operation.

  • Finds the most recent common Snapshot copy between the source and destination volumes. Performs a local rollback transfer to give the active file system the same data as the common Snapshot copy. It then loops through a sequence, creating a Snapshot copy on the source volume, transferring the data captured in that Snapshot copy, creating a Snapshot copy of the data on the destination, and repeating until the relationship is close to InSync. After the last transfer, it enters cutover to bring the relationship to InSync.

  • User-created Snapshot copies are not replicated by a resync operation.

  • At the conclusion of the resync operation, the exported Snapshot copy on the destination is removed and the client will then see the active file system on the destination volume. The relationship will be InSync and periodic creation of common Snapshot copies will resume.

The snapmirror resync command supports an optional parameter "preserve" . The parameter "preserve" is only supported for extended data protection (XDP) relationships. It is not supported for relationships with a non-Data ONTAP endpoint. It is not supported for relationships with a policy of type strict-sync-mirror and sync-mirror . When used, the parameter "preserve" changes the behavior of the snapmirror resync command. The changed behavior of the command can be described as follows:

  • Finds the most recent common Snapshot copy between the source and destination volumes, preserves all Snapshot copies on the destination volume that are newer than the common Snapshot copy, and mounts the destination volume as a DP volume with the common Snapshot copy as the exported Snapshot copy.

  • Performs a local rollback transfer to make a copy of the common Snapshot copy on the destination volume and establish it as the latest Snapshot copy on the destination volume. The command then transfers all Snapshot copies that are newer than the common Snapshot copy, from the source volume to the destination volume. The command only transfers Snapshot copies that match the relationship's policy, i.e., Snapshot copies will match rules associated with the policy as defined by the snapmirror policy commands.

If a SnapMirror relationship does not already exist, that is, the relationship was not created using the snapmirror create command, the snapmirror resync command will implicitly create the SnapMirror relationship, with the same behaviors as described for the snapmirror create command before resyncing it.

For Vservers, you must create SnapMirror relationships between Vservers by using the snapmirror create command before you run the snapmirror resync command. The snapmirror resync command does not implicitly create the relationship.

This command is supported for SnapMirror relationships with the field "Relationship Capability" showing as either "8.2 and above" or "Pre 8.2" in the output of the snapmirror show command.

For relationships with "Relationship Capability" of "8.2 and above" , you can track the progress of the operation using the snapmirror show command.

For relationships with "Relationship Capability" of "Pre 8.2" , a job will be spawned to operate on the SnapMirror relationship, and the job id will be shown in the command output. The progress of the job can be tracked using the job show and job history show commands.

The snapmirror resync command fails if the destination volume does not have a Snapshot copy in common with the source volume.

The snapmirror resync command does not work on load-sharing mirrors.

The snapmirror resync command must be used from the destination Vserver or cluster.

Parameters

{ [-S, -source-path {<[vserver:][volume]>|<[[cluster:]//vserver/]volume>|<hostip:/lun/name>|<hostip:/share/share-name>|<[vserver:]/cg/[cgname]>}] - Source Path

This parameter specifies the source endpoint of the SnapMirror relationship in one of four path formats. The normal format includes the names of the Vserver (vserver) and/or the volume (volume). To support relationships with "Relationship Capability" of "Pre 8.2" , a format which also includes the name of the cluster (cluster) is provided. The "Pre 8.2" format cannot be used when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" . For SnapMirror relationships with an AltaVault source, the source endpoint is specified in the form hostip:/share/share-name . For SnapMirror relationships with a SolidFire source, the source endpoint is specified in the form hostip:/lun/name .

| [-source-cluster <Cluster name>] - Source Cluster

Specifies the source cluster of the SnapMirror relationship. If this parameter is specified, the -source-vserver and -source-volume parameters must also be specified. This parameter is only applicable for relationships with "Relationship Capability" of "Pre 8.2" . This parameter cannot be specified when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" .

[-source-vserver <vserver name>] - Source Vserver

Specifies the source Vserver of the SnapMirror relationship. For relationships with volumes as endpoints, if this parameter is specified, parameters -source-volume and for relationships with "Relationship Capability" of "Pre 8.2" , -source-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP source endpoints.

[-source-volume <volume name>] - Source Volume }

Specifies the source volume of the SnapMirror relationship. If this parameter is specified, parameters -source-vserver and for relationships with "Relationship Capability" of "Pre 8.2" , -source-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP source endpoints.

{ -destination-path {<[vserver:][volume]>|<[[cluster:]//vserver/]volume>|<hostip:/lun/name>|<hostip:/share/share-name>|<[vserver:]/cg/[cgname]>} - Destination Path

This parameter specifies the destination endpoint of the SnapMirror relationship in one of four path formats. The normal format includes the names of the Vserver (vserver) and/or volume (volume). To support relationships with "Relationship Capability" of "Pre 8.2" , a format which also includes the name of the cluster (cluster) is provided. The "Pre 8.2" format cannot be used when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" . For SnapMirror relationships with AltaVault destinations, the destination endpoint is specified in the form hostip:/share/share-name . For relationships with SolidFire destinations, the destination endpoint is specified in the form hostip:/lun/name .

| [-destination-cluster <Cluster name>] - Destination Cluster

Specifies the destination cluster of the SnapMirror relationship. If this parameter is specified, parameters -destination-vserver and -destination-volume must also be specified. This parameter is only applicable for relationships with "Relationship Capability" of "Pre 8.2" . This parameter cannot be specified when operating in a Vserver context on relationships with "Relationship Capability" of "8.2 and above" .

-destination-vserver <vserver name> - Destination Vserver

Specifies the destination Vserver of the SnapMirror relationship. For relationships with volumes as endpoints, if this parameter is specified, parameters -destination-volume and for relationships with "Relationship Capability" of "Pre 8.2" , -destination-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP destination endpoints.

-destination-volume <volume name> - Destination Volume }

Specifies the destination volume of the SnapMirror relationship. If this parameter is specified, parameters -destination-vserver and for relationships with "Relationship Capability" of "Pre 8.2" , -destination-cluster must also be specified. This parameter is not supported for relationships with non-Data ONTAP destination endpoints.

[-s, -source-snapshot <text>] - Source Snapshot

This optional parameter specifies a Snapshot copy to transfer. The default behavior for a data protection relationship with a read-write source is that Data ONTAP creates a new Snapshot copy and uses it as the basis for determining what data are replicated; with this option, the specified Snapshot copy will be used instead. The default behavior for an extended data protection relationship depends on the relationship's policy type. For a data protection relationship, the specified Snapshot copy must be newer than the latest common Snapshot copy. For an extended data protection relationship, the specified Snapshot copy can be newer or older than the common Snapshot copy. This parameter is not supported for relationships with "Relationship Capability" of "Pre 8.2" .

[-type <snapmirrorType>] - Snapmirror Relationship Type

Specifies the type of SnapMirror relationship if a relationship is implicitly created. This parameter is the same as the one used in the snapmirror create command.

[-policy <sm_policy>] - SnapMirror Policy

This optional parameter designates the name of the SnapMirror policy which is associated with the SnapMirror relationship. If you do not designate a policy, the current policy will be retained. This parameter is not applicable to relationships with "Relationship Capability" of "Pre 8.2" .

Note You define and name a policy using the snapmirror policy create command.
[-f, -force <true>] - Force

If this parameter is specified, the command proceeds without prompting for confirmation.

[-k, -throttle <throttleType>] - Throttle (KB/sec)

This optional parameter limits the network bandwidth used for the resync transfer. It sets the maximum rate (in Kbytes/sec) at which data can be transferred during the operation. If this parameter is not specified, the throttle value configured for the relationship with the snapmirror create or snapmirror modify command will be used. To fully use the network bandwidth available, set the throttle value to unlimited or 0 . The minimum throttle value is four Kbytes/sec, so if you specify a throttle value between 1 and 4 , it will be treated as if you specified 4 . For FlexGroup relationships, the throttle value is applied individually to each constituent relationship. For relationships with a policy of type strict-sync-mirror or sync-mirror , the throttle value is applicable only for the asynchronous transfers of the resync operation. The -throttle parameter does not affect load-sharing transfers and transfers for other relationships with "Relationship Capability" of "Pre 8.2" confined to a single cluster.

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

This optional parameter specifies the priority at which the transfer runs. The default value for this parameter is the value in the SnapMirror policy associated with this relationship. This parameter is not applicable to relationships with a "Relationship Capability" of "Pre 8.2" .

[-preserve <true>] - Preserve

This parameter is only supported for extended data protection (XDP) relationships with policies of type vault , and mirror-vault . It is not supported for relationships with a policy of type async-mirror and data protection and load-sharing relationships. This parameter is not supported for relationships with non-Data ONTAP endpoints. It is not supported for relationships with a policy of type strict-sync-mirror and sync-mirror . When specified, it changes the behavior of the snapmirror resync command to preserve Snapshot copies on the destination volume that are newer than the latest common Snapshot copy. This parameter is not supported for relationships with "Relationship Capability" of "Pre 8.2" .

[-quick-resync <true>] - Quick Resync

This parameter is only supported for extended data protection (XDP) relationships. This parameter is not supported for relationships with non-Data ONTAP endpoints. It is not supported for relationships with a policy of type strict-sync-mirror and sync-mirror . Specifying this optional parameter reduces the resync time because the resync does not incur storage efficiency overhead before the transfer of new data. Specifying this parameter is recommended if the source of the resync does not have volume efficiency enabled or if reducing resync time is more important than preserving all possible storage efficiency. When this parameter is specified, resync does not preserve the storage efficiency of the new data with existing data over the wire and on the destination.

[-cg-item-mappings {<source volume>:@<destination volume>|<source item path>:@<destination item path>}] - Consistency Group Item Mappings

This optional parameter specifies a list of the consistency group (CG) item mappings. It is considered only if the supplied source and destination path values denote valid CG paths. For CG level relationships, this parameter must be specified. The value for this parameter must contain mappings of one or more pairs of constituent source and destination volumes of the form srcvol1:@dstvol1,…​ .

[-is-auto-expand-enabled {true|false}] - Is Auto Expand Enabled

This optional parameter specifies whether or not a FlexGroup SnapMirror relationship and its destination FlexGroup should be auto-expanded if the source FlexGroup is expanded. This parameter is supported only for FlexGroup SnapMirror relationships. If this resync is creating a new Snapmirror relationship, the default value is true. If it is not creating a new relationship, if a value is specified, it must match the current value for the existing relationship. If the parameter is not specified, the existing value will be retained.

[-w, -foreground <true>] - Foreground Process

This specifies whether the operation runs as a foreground process. If this parameter is specified, the default setting is true (the operation runs in the foreground). When set to true , the command will not return until the process completes. This parameter is only applicable to relationships with "Relationship Capability" of "Pre 8.2" .

Examples

To reestablish mirroring for the destination endpoint vs2.example.com:dept_mkt_mirror that has been previously broken off with the snapmirror break command, type the following command:

vs2.example.com::> snapmirror resync -destination-path
       vs2.example.com:dept_mkt_dp_mirror

For relationships with "Relationship Capability" of "Pre 8.2" , to reestablish mirroring for the destination endpoint cluster2://vs2.example.com/dept_mkt_mirror that has been previously broken off with the snapmirror break command, type the following command:

cluster2::> snapmirror resync -destination-path
         cluster2//vs2.example.com/dept_mkt_dp_mirror

To create a SnapMirror relationship and reestablish mirroring between the destination endpoint named vs2.example.com:dept_eng_dp_mirror2 and the source endpoint named vs1.example.com:dept_eng , type the following command:

vs2.example.com::> snapmirror resync -destination-path
         vs2.example.com:dept_eng_dp_mirror2
         -source-path vs1.example.com:dept_eng

To create a SnapMirror relationship and reestablish mirroring between the destination endpoint named cluster2://vs2.example.com/dept_eng_dp_mirror2 and the source endpoint named cluster1://vs1.example.com/dept_eng when the source cluster is running Data ONTAP 8.1 software, type the following command:

cluster2::> snapmirror resync -destination-path
         cluster2://vs2.example.com/dept_eng_dp_mirror2
         -source-path cluster1://vs1.example.com/dept_eng

To create and reestablish an extended data protection (XDP) relationship between the Data ONTAP source endpoint vs1.example.com:data_ontap_vol , and the non-Data ONTAP (for example, AltaVault) destination endpoint 10.0.0.11:/share/share1 , and start the initial transfer, type the following command:

vs1.example.com::> snapmirror resync -destination-path
  10.0.0.11:/share/share1
  -source-path vs1.example.com:data_ontap_vol -type XDP

To reestablish mirroring for the destination endpoint dvs1.example.com: of a Vserver relationship that has been previously broken off with the snapmirror break command, type the following command:

cluster2::> snapmirror resync -destination-path
         dvs1.example.com:

To resynchronize the SnapMirror Business Continuity (SMBC) relationship with the source Consistency Group cg_src in Vserver vs1.example.com and the destination Consistency Group cg_dst in Vserver vs2.example.com , type the following command from the destination cluster:

destination::> snapmirror resync -destination-path
            vs2.example.com:/cg/cg_dst

To create and resynchronize an SMBC relationship with the following attributes:

  • It is between the source Consistency Group cg_src in Vserver vs1.example.com , and the destination Consistency Group cg_dst in Vserver vs2.example.com .

  • It has item mappings between volumes srcvol1 and srcvol2 and volumes dstvol1 and dstvol2 .

  • It uses the default policy named AutomatedFailOver that has a policy type of automated-failover .

Type the following command from the destination cluster:

destination::> snapmirror resync -destination-path
            vs2.example.com:/cg/cg_dst -source-path
            vs1.example.com:/cg/cg_src
            -cg-item-mappings srcvol1:@dstvol1,srcvol2:@dstvol2