Symantec logo

Administering snapshots

Refreshing snapshots

The vxrvg snaprefresh command allows you to refresh the snapshots of the volumes in an RVG. It creates a new point-in-time image of the volume. For example, a snapshot taken on Monday can be refreshed on Tuesday. Before refreshing the snapshot make sure the data volumes are consistent at the application level by either freezing or pausing replication. After refreshing the snapshot, unfreeze replication if you are using IBC messaging; otherwise, if you have paused replication, resume it.


  Note   If the Secondary RVG is inconsistent, then VVR does not allow you to refresh the snapshots using the volumes under this RVG.


Use the following command to refresh existing snapshots:

# vxrvg -g diskgroup [-P <prefix>] snaprefresh rvg_name


  Note   After refreshing the snapshots you must issue the command vxsnap syncstart to start synchronizing the instant full snapshots. This is not required for instant space-optimized snapshots.


Reattaching the snapshot plexes to the data volumes (snapback)

The snapback operation reattaches the snapshots of the instant full snapshot volume or the plexes of the plex breakoff snapshot volume back to the original volume. After working with the snapshot volumes, you can reattach the plexes to the data volumes in the RVG using the snapback operation. The snapback operation is instant as the plexes are resynchronized in the background.


  Note   The snapback operation can be performed only on instant full snapshots and plex-breakoff snapshots but not on space-optimized snapshots.


The vxrvg snapback command snaps back the snapshot, that is, reattaches the snapshot plexes to their respective data volumes in the RVG. Note that if an RVG consists of VxVM ISP volumes then you must use the -f force option to reattach the snapshot plexes to their data volumes. Not using the force option causes the operation to fail with an error message.

You can use the default action of the vxrvg snapback command if the data volumes in the RVG have only 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.

Note that if the plexes had been added using the vxsnap addmir command, then vxrvg snapback command will reattach the plexes in the snapdone state. Otherwise, it will reattach the plexes in the active state.

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 when used with the vxrvg snapback command enables you to reattach a specific set of snapshots that have been identified by the prefix. To snapback all the data volumes with the prefix month in their names, specify the prefix month using the -P option.

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

# vxrvg -g diskgroup -P prefix snapback rvg_name

To snapback the plexes from all snapshots, of the 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 the 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.

Restoring data from the snapshots

Use the vxrvg snaprestore command to restore the data from the required snapshots.


  Note   When restoring the volumes you must specify the exact snapshot corresponding to the respective volumes that need to be restored. Therefore, it is recommended that you create snapshots with prefixes using the -P option so that they can be easily restored. However, if you do not specify any prefix, the default prefix SNAP will be used. The vxrvg snaprestore command can be used only for restoring the data from the instant snapshots.


# vxrvg -g diskgroup [-P prefix] snaprestore rvg_name

The restore operation is very useful when the data in a volume is corrupted, for example, because of a software or user error, and must be restored to a known state preserved in a snapshot of that volume taken some time earlier. Because a replicated volume under the RVG propagates all changes to the Secondary, the Secondary volume must be restored back to a known state. VVR can now do this automatically using the instant snapshots. It uses the DCM logging to resynchronize the Secondary so that only the regions changed as part of the restore operation are applied to the Secondary volumes.

If there are multiple RLINKs in an RVG, then VVR synchronizes all the Secondary hosts using the bits on the DCM log. If one of the RLINKs is already in a DCM mode, then VVR also updates the bits corresponding to the regions that need to be restored as a part of the restore operation to the DCM. Now, VVR resynchronizes all the Secondary hosts using the consolidated bits on the DCM log.


  Note   In case of the multiple RLINK setup, if either the autosync or resync operation was already in progress across some RLINK in the RVG, then the resynchronization for the other RLINKs that have already switched to the DCM mode as a part of the restore operation starts automatically.


The vxrvg snaprestore command can be used to restore data both from the Primary and the Secondary. On the Primary the vxrvg snaprestore command populates the DCM for replay that can be used on the Secondary only if it has no attached RLINKS or if the RLINK is in the fail state. For more information, refer to Rules for restoring volumes.


  Note   Restoring data on the Primary RVG volumes using the vxrvg snaprestore command deletes all the existing checkpoints.



Rules for restoring volumes

The volumes in an RVG can be restored only according to the rules mentioned below. This is irrespective of whether the volumes are restored using the vxrvg snaprestore command or specific volumes under the RVG are restored using the vxsnap restore command.

On Primary

  1. If the RLINK is detached, the volume is restored like any other VxVM volume.
  2. If the RLINK is active, the RLINK is put into DCM logging mode and the regions that need to be modified by the restore operation are marked on the DCM, and the volume is restored. The RVG must be resynchronized using vxrvg resync command, to ensure that the restored data is available on the Secondary RVG. This is independent of the SRL protection setting and works even if the srlprot attribute is not set to dcm or autodcm.
  3. If the RLINK is active and the volumes are not DCM logging enabled, then the restore operation fails, unless the -f (force) option is specified. If the force option is specified, the RLINK is detached before the volume is restored.

On Secondary

The restore operation is allowed only if:

 To restore the snapshots on the Primary

On Primary:

  1. To stop the specific RVG use the following command:

    # vxrvg -g hrdg stop hr_rvg

  2. To restore the volumes from snapshot with a specific prefix, use the following command:

    # vxrvg -g hrdg -P JULY snaprestore hr_rvg

    The RLINK changes to the DCM mode if it is not already in this mode.

  3. To replicate the new changes to the Secondary, use the following command:

    # vxrvg -g hrdg resync hr_rvg

Displaying the snapshot information

The vxrvg snapprint command displays information on the relationship that exists between the original volumes and the corresponding snapshots. To display information on the snapshots use the following command:

# vxrvg -g diskgroup snapprint rvg_name

The output of the command resembles:

vxrvg snapprint hr_rvg

Creation Time : Fri Feb 14 02:25:58 2003

Source Volume Snapshot Volume Snapshot Type Sync Status

------------- --------------- ------------- -----------

hr-dv01 JULY1-dv01 Inst-Full Complete

hr-dv02 JULY1-dv02 Inst-Full Complete

Creation Time : Fri Feb 14 02:25:45 2003

Source Volume Snapshot Volume Snapshot Type Sync Status

------------- --------------- ------------- -----------

hr-dv01 JULY-dv01 Inst-Full Complete

hr-dv02 JULY-dv02 Inst-Full Complete

Creation Time : Fri Feb 14 01:46:38 2003

Source Volume Snapshot Volume Snapshot Type Sync Status

------------- --------------- ------------- -----------

hr-dv01 SO1-dv01 Inst-SO Incomplete

hr-dv02 SO1-dv02 Inst-SO Incomplete

Creation Time : Fri Feb 14 01:44:55 2003

Source Volume Snapshot Volume Snapshot Type Sync Status

------------- --------------- ------------- -----------

hr-dv01 SO-dv01 Inst-SO Incomplete

hr-dv02 SO-dv02 Inst-SO Incomplete

Creation Time : Thu Feb 13 09:14:11 2003

Source Volume Snapshot Volume Snapshot Type Sync Status

------------- --------------- ------------- -----------

hr-dv01 JUNE-vol1 Inst-Full Complete

hr-dv02 JUNE-vol2 Inst-Full Complete


  Note   The vxrvg snapprint command can also be used to display the status of the snapshots that have been created using the traditional snapshot feature. However, this output will not display the correct time.


Destroying the snapshots

The vxrvg snapdestroy command enables you to destroy or delete the snapshot volumes from the RVG. The vxrvg snapdestroy command first dissociates the snapshot volumes from the original volumes and then destroys the volumes.

To destroy the snapshot volumes, use the following command:

# vxrvg -g diskgroup [-P prefix] [-o keepcache] snapdestroy \

rvg_name

The argument snapdestroy along with the different attributes specifies the snapshot that is to be destroyed.

By default, the snapdestroy attribute removes the cache object along with the instant snapshots of the specified prefix. However, if you specify the -o keepcache option, then the cache object is not deleted. The -o keepcache option can be specified only for the pre-created cache objects. The same cache object can then be used for creating new snapshots.