Symantec logo

Using the traditional snapshot feature

This snapshot feature of VVR enables you to break off mirrors from the data volumes in an RVG thus providing snapshots of the data volumes in the RVG. Snapshots can be used to perform operations such as Decision Support Systems (DSS) and backup. Snapshots can also be used to retain a consistent copy of the Secondary data volumes during Data Change Map (DCM) resynchronization.

The vxrvg snapshot command takes a snapshot of all the volumes in the RVG at a single point in time; therefore, the operation is atomic in nature. The vxrvg snapback command reattaches the plexes of the snapshot volumes to the original data volumes in the RVG. The vxrvg snapshot command creates the same type of snapshot on the data volumes as a vxassist snapshot command would create on a volume associated or unassociated with an RVG. To snapshot and snapback a specific volume or specific plexes of one or more volumes, use the vxassist command.

If an RVG contains a volume set, the vxrvg snapshot command can be used to take snapshots of its data volumes.

Using the snapshot feature involves the following tasks:

Creating snapshot plexes for data volumes in an RVG

To use the RVG snapshot feature, create snapshot plexes for each data volume in the RVG. Creating the snapshot plexes is a one-time operation.

To create a snapshot plex for a volume, use the following command:

# vxassist -g diskgroup snapstart dv_name

The vxassist snapstart command creates a new plex for the volume dv_name and attaches it to the volume. When the attach is complete, the state of the plex is snapdone and a snapshot can be taken.

Freezing or pausing replication

Before taking the snapshot on the Secondary, make the data volumes consistent at the application level by either freezing or pausing replication. To make the data volumes consistent at the application level, use the IBC Messaging utility vxibc. For more information, see Using VVR for off-host processing. For a failed Primary, pause the Primary RLINK, and then take a snapshot of the RVG. If you do not use vxibc, pause the RLINK before taking the snapshot.

Taking a snapshot

The vxrvg snapshot command takes snapshots of the data volumes in the RVG. It creates a snapshot volume with the name SNAP-dv_name for each data volume in the RVG.

Each data volume in an RVG can have more than one snapshot volume. The -P option to the vxrvg snapshot command enables you to specify a prefix for the names of the snapshot plexes. If you specify the prefix month, the name of each snapshot data volume starts with month; the resulting snapshot volume is named month-dv_name. For example, the data volume hr_dv01 can have snapshot volumes such as june-hr_dv01, july-hr_dv01.

To take a snapshot of each data volume in an RVG, use the following command:

# vxrvg -g diskgroup snapshot rvg_name

To specify a prefix for the snapshot of each data volume in an RVG, use the following command:

# vxrvg -g diskgroup -P june snapshot rvg_name

A snapshot data volume with the name june-dv_name is created for each data volume in the RVG. You can have more than one snapshot of the data volumes in an RVG.

Perform the required operation on the snapshots; then snapback, that is, reattach the snapshots to the data volumes in the RVG using the vxrvg snapback command.

Unfreezing or resuming replication

After taking a snapshot, unfreeze replication if you are using IBC messaging; otherwise if you have paused replication resume it. The snapshots are ready for use.

Performing the required operations on the snapshot

Use snapshots to perform off-host processing operations including Decision Support Systems (DSS), backup, and trial failover in VVR. Snapshots can also be used to keep a consistent copy of the data volumes in an RVG when DCM resynchronization is in progress. After performing the required operation on the snapshots, reattach them.

Reattaching the snapshot plexes to the data volumes (Snapback)

The snapback operation reattaches a snapshot volume with the original volume. After working with the snapshot volumes, reattach them to the data volumes in the RVG. The snapback operation may take a long time to complete because it performs a complete resynchronization of the snapshot plexes. To perform a faster and more efficient snapback operation, see Using the traditional snapshot feature.

The vxrvg snapback command snaps back, that is, it reattaches the snapshot plexes to their respective data volumes in the RVG.

You can use the default action of the vxrvg snapback command if the data volumes in the RVG have one snapshot. If the data volumes have more than one snapshot plex, use the -a option with the vxrvg snapback command to reattach all snapshots; the -a option snaps back all the plexes to their original data volumes. For example, use the -a option to reattach the snapshot volumes june-dv_name and july-dv_name to each data volume dv_name in the RVG.

The -P option to the vxrvg snapback command enables you to reattach a specified snapshot. To reattach all the data volumes with the prefix month in their names, specify the prefix month using the -P option.

For data volumes with single snapshot plexes in an RVG, snapback using the following command:

# vxrvg -g diskgroup snapback rvg_name

To snapback all plexes for each data volume in an RVG, use the following command:

# vxrvg -g diskgroup -a snapback rvg_name

All the snapshot plexes are snapped back to their original data volumes in the RVG rvg_name.

To snapback snapshot plexes with a specific prefix for all data volumes in an RVG, use the following command:

# vxrvg -g diskgroup -P june snapback rvg_name

Snapshot plexes with the name june-dv_name are snapped back to their original data volumes in the RVG.

To snapback a plex to a specific data volume in an RVG, use the following command:

# vxassist -g diskgroup snapback SNAP-dv_name

For more information on using the vxassist snapback command, see the Veritas Volume Manager Administrator's Guide.

Using snapback with resyncfromreplica option

The default action of the vxassist snapback command is to resynchronize the snapshot plex with the contents of the original volume. The resyncfromreplica option of the vxassist snapback command synchronizes the original volume with the contents of the snapshot plex. This operation is similar to a restore from a backup operation. In most cases, the default action of the vxassist snapback command must be used, but there are some situations where the resyncfromreplica option may be used. The vxrvg snapback command does not provide the resyncfromreplica option, therefore, the operation must be performed one volume at a time. The resyncfromreplica operation is not allowed on the Primary or the Secondary SRL.


  Caution   Improper use of the resyncfromreplica option of the vxassist snapback command on a replicated volume can cause data corruption. You must read the following sections before proceeding.



Using resyncfromreplica option to recover from logical corruption of data

If there is a logical corruption of data and a good snapshot of the data volumes exists, it can be used to restore the data volumes to a version before the error occurred. If the snapshot exists on the Primary, before issuing the vxassist -o resyncfromreplica snapback command, shutdown the application and detach all the RLINKs. The resyncfromreplica operation will fail if the RLINK is not detached. On completing the snapback operation, perform a complete synchronization of the Secondary data volumes. Refer to Methods to synchronize the Secondary.

If the snapshots exist on the Secondary, before issuing the vxassist -o resyncfromreplica snapback command, migrate the Primary role to this Secondary host, but do not start the application. Refer to Migrating the Primary. After migrating the Primary role, detach the RLINK to the original Primary, which is now a Secondary, and then perform the snapback operation. On completing the snapback operation, perform a complete synchronization of the Secondary data volumes.

If you choose to completely synchronize the Secondary using a checkpoint, make sure that any Primary checkpoints that were taken before the snapback operation are not used to resynchronize the Secondary. VVR may show these checkpoints as valid if they have not overflowed; however, the checkpoints are not valid. You can only use Primary checkpoints taken after the resyncfromreplica operation to resynchronize the Secondaries.


Using resyncfromreplica to recover failed Secondary data volumes

The resyncfromreplica option can also be used to restore Secondary data volumes that are corrupt due to disk errors. In this case, the data volumes can be restored from existing snapshots. The RLINK must be in the fail state to perform the resyncfromreplica operation. See Restoring the Secondary from online backup. Use these snapshots instead of backups.

If you choose to restore the Secondary using checkpoints, you must ensure that:

VVR cannot ensure or check if the above conditions are met and failure to meet all of the conditions can result in an inconsistency between the Primary and the Secondary.