Previous  |  Next  >  
Product: Volume Replicator Guides   
Manual: Volume Replicator 4.1 Administrator's Guide   

Creating RVG Snapshots

VVR enables you to create snapshots that are images of the online data volumes at a given point in time. The data in the original volume may change; however, the snapshot can still be used as a stable and independent copy for various purposes. VVR provides two methods of creating snapshots: instant snapshots and traditional snapshots.


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

The instant snapshot feature is a separately licensed feature of VVR. The advantages of this method over the traditional snapshot method are that the snapshots are available immediately, and they may be space-optimized, thus requiring less space than the traditional snapshots. For more information on instant snapshots, see Using the Instant Snapshot Feature.

With the traditional snapshot method, depending on the size of the volume, the time required for initial synchronization of the plexes can be very large. For more information on traditional snapshots, see Using the Traditional Snapshot Feature.

After a volume has been prepared for the instant snapshot feature, you cannot use it to take a snapshot using the traditional snapshot method. To use the traditional snapshot method, you must first unprepare the volume. Thus, you cannot use the same volume for both the traditional method and the instant snapshot method at the same time.

If an RVG contains component volumes of a volume set, the vxrvg snapshot command cannot be used to take snapshots of its data volumes. To take snapshots of the data volumes in an RVG that contains component volumes of a volume set, use the vxsnap make command.

If an RVG consists of VxVM ISP volumes, then you can create only instant full or space-optimized snapshots of the volumes in the RVG. When creating instant space-optimized snapshots, make sure you create the cache object beforehand because the cachesize parameter is not supported for an RVG with VxVM ISP volumes.

Using the Instant Snapshot Feature

VVR enables you to create instant snapshots using the vxrvg snapshot command. This command takes snapshots of the data volumes in the RVG. However, the snapshot volumes are not part of the RVG. Each data volume in an RVG can have more than one snapshot volume. When creating full instant or space-optimized snapshots, the snapshot volumes do not need to be synchronized beforehand, therefore the snapshots are available instantly. The snapshot volumes are then synchronized later in the background.


Snapshot Naming Conventions

The snapshot volumes must be created using the correct naming convention, that is, <prefix>-dv_name. You can create snapshot volumes with appropriate prefixes using the -P option. However, you must ensure that this prefix matches the prefix that you specified for the data volumes.

For example, if you specify the prefix as month, the name of each snapshot data volume will start with the prefix month; that is, it will be named as month-dv_name. Thus, a data volume hr_dv01 can have snapshot volumes such as june-hr_dv01, july-hr_dv01.


Note   Note    We recommend that you create snapshots with prefixes using the -P option so that the snapshots can be easily identified for restoring the data. However, if you do not specify any prefix, the default prefix SNAP will be used.

The instant snapshot feature provides the following methods to create instant snapshots:

Instant Full Snapshot

The vxrvg -F snapshot command enables you to create an instant full snapshot of all the volumes in the RVG, at a single point in time. The snapshot is available for use immediately, because the snapshot volumes do not have to be completely synchronized, in the beginning. The snapshots volumes are synchronized later in the background.

The vxrvg snapshot command creates the data volume snapshots for all the volumes in the RVG, similar to the ones created by the vxsnap make command.


Note   Note    You must create and prepare the snapshot volumes before they can be used for creating snapshots.

Prerequisites for creating instant full snapshots

    Checkmark  Make sure you create the snapshot volumes and then prepare them before creating the snapshots.

    Checkmark  Make sure the snapshot volumes are the same size as the original volumes.

    Checkmark  Make sure the snapshot volumes follow a proper naming convention such that the snapshot volume names can be easily linked to the original volumes. For more information, refer to the section Snapshot Naming Conventions.

The steps required to create instant full snapshots are as follows:

  • Creating Snapshot Volumes for Data Volumes in an RVG
  • Preparing the Volume
  • Freezing or Pausing Replication
  • Taking a Snapshot
  • Unfreezing or Resuming Replication

Creating Snapshot Volumes for Data Volumes in an RVG

You must create snapshot volumes for the data volumes in an RVG before you take an instant full snapshot, because the vxrvg snapshot command does not create the snapshot volumes. Use the vxassist make commands or other Volume Manager commands to create the required volumes. For more information on creating the volumes, refer to the VERITAS Volume Manager Administrator's Guide.

Preparing the Volumes


Upgrading the disk group

To use the instant snapshot feature, the disk groups must be version 120 or above. If you are using disk groups created with an earlier disk group version, the first step in preparing the volumes is to upgrade the disk groups.

To explicitly upgrade the disk groups, run the vxdg upgrade command. For details on upgrading disk groups, refer to the VERITAS Volume Manager Administrator's Guide.


Preparing volumes for an instant snapshot

Use the following command to prepare the volumes for instant snapshots:


vxsnap -g diskgroup prepare volume [region=size] \
   [ndcomirs=number] [storage_attribute...] 
Note   Note    Run this command once on every data volume in the RVG.

After running the command the volumes are ready for the instant snapshot operations. Use the following command to verify whether the volumes are prepared. This command checks the settings of the instant flag for the required volumes:


# vxprint -g diskgroup -F%instant <volume>

For more information on the vxsnap prepare command, refer to the VERITAS Volume Manager Administrator's Guide.

Freezing or Pausing Replication

Before taking the snapshot on the Secondary, make sure the data volumes are 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 information on using the vxibc utility, refer to Using VVR for Off-Host Processing. For a failed Primary, you can pause the Primary RLINK, and then take a snapshot of the RVG. If you do not use vxibc, you pause the RLINK before taking the snapshot.

VVR provides you with sample scripts that can be used to freeze the replication before creating instant snapshots. When you install VVR, these scripts are installed in the following directory:


/etc/vx/vvr/ibc_scripts/sample_so_snapshot

Refer to the README file in this directory for instructions on how to use the sample scripts to create the instant snapshots.

Creating Instant Full Snapshots

Use the following command to create an instant full snapshot for each data volume in an RVG:


# vxrvg -g diskgroup [-P prefix] -F snapshot rvg_name \
   [instantso=volume_list {cache=cachename|cachesize=size}] \
    [plexbreakoff=volume_list [plexprefix=plex_prefix]]\
     [exclude=volume_list] [syncing=yes|no] [comment="<comment>"]
Use the vxrvg snapshot command with its different attributes to specify the type of snapshot that you want to create. The -F option specifies instant full snapshots. By default, all the volumes in the RVG are considered for the instant full snapshots. To exclude any of the volumes from being considered for the instant full snapshots, use one of the following attributes. Depending on the attribute specified with the vxrvg snapshot command, the appropriate snapshots of the volumes are created.
The attribute instantfull need not be specified when the -F option is specified. This option can be used only if the -F option has not been specified and you still require a full instant snapshot of some of the volumes.
The attribute exclude specifies a comma-separated list of volumes that do not need to be considered for any kind of snapshots.
The attribute instantso specifies a comma-separated list of volumes that can be included for instant space-optimized snapshots when taking the instant full snapshots.
The attribute syncing specifies whether you want to start synchronizing the volumes in the background. By default, the value for this attribute is yes. The synchronization process can be started or stopped as required. For more information, refer to Synchronizing Volumes on the Local Host and Remote Hosts.

By default, when using the vxrvg snapshot command with the -F option you need not specify the volume list since all the volumes are included. However, you can also specify the volume list for the instantso, plexbreakoff and the exclude attribute when using the -F option. This will result in some volumes having an instant full snapshot, some having an instant space-optimized snapshot and some of them being excluded.

Any volumes in the RVG that are not specified in the volume_lists of the attributes exclude, plexbreakoffor instantso will be snapped in the same way as the specified snapshot type, which is the instant full snapshot. Note that it is not possible to create two different types of snapshots for the same volume. The snapshot operation may result in some volumes with no snapshots and some with one of the three types of snapshots.

You can also reattach the snapshots to the data volumes in the RVG using the vxrvg snapback command. For more information on reattaching the snapshots, refer to Reattaching the Snapshot Plexes to the Data Volumes (snapback).


Example:

To specify a prefix for the snapshots of each data volume in an RVG, use the following command. Make sure the snapshot volumes have been created in advance.


  # vxrvg -g diskgroup -P june -F 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.

Example:

This example describes the steps to create an instant full snapshot for an RVG:

  1. Find the size of the original volumes for which you want to create snapshots on the hosts seattle or london.
    vxprint -g hrdg -F"%name %len" hr_dv01 hr_dv02

    OR


    vxprint -g hrdg -F"%name %len" 'vxrvg getdatavols hr_rvg'
  2. Prepare the volumes for the instant snapshot operations, by using the following command on each data volume in the RVG for which you intend to create snapshots:
    vxsnap -g hrdg prepare hr_dv01 
    vxsnap -g hrdg prepare hr_dv02 
    Note   Note    Make sure that all the applications running on these volumes are closed.
  3. Create the snapshot volumes of the same size (or greater) as the original volumes and with an appropriate prefix.
    vxassist -g hrdg make JUNE-hr_dv01 20971520   
    vxassist -g hrdg make JUNE-hr_dv02 20971520
  4. Prepare the snapshot volumes:
    vxsnap -g hrdg prepare JUNE-hr_dv01 
    vxsnap -g hrdg prepare JUNE-hr_dv02 
  5. Pause or freeze replication on the Secondary.

    For more details on pausing replication, refer to Pausing and Resuming Replication to a Secondary. For more information on freezing replication, refer to Using the In-Band Control Messaging Utility vxibc and the IBC Programming API.

  6. Create a snapshot of the required volumes in the RVG:
    vxrvg -g hrdg -F -P JUNE snapshot hr_rvg

    This command creates a snapshot of all the volumes in the RVG with a prefix JUNE.

  7. Resume or unfreeze replication on the Secondary.

    For more information on resuming replication, refer to Pausing and Resuming Replication to a Secondary. For more information on unfreezing replication, refer to Using the In-Band Control Messaging Utility vxibc and the IBC Programming API.

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 now ready for use.

Instant Space-Optimized Snapshots

The vxrvg -S snapshot command creates an instant space-optimized snapshot of all the volumes in the RVG at a single point in time. The vxrvg snapshot command creates the same type of snapshots as the vxsnap make command and uses a cache object that functions as a space-optimized persistent store. The space required by the space-optimized snapshots is less than that of the original volume because space-optimized snapshots store only the changed data. The data change between the source volume and the snapshot usually is minimal during the lifetime of the snapshot.

If the size of the cache object is not enough for the incoming writes, the cache object can grow in size automatically, provided that the autogrow attribute has been set to on.

The values of the highwatermark, autogrowby and maxautogrow attributes can be set when a cache object is created using vxmake. If necessary, you can use the vxcache set command to change the values of these attributes for an existing cache. The default value for these attributes is as follows:

Attribute Default value

autogrow

Default is off.

autogrowby

Default value is 20% of the size of the cache volume in blocks.

highwatermark

Default is 90% of the size of the cache volume in blocks.

maxautogrow

Default is twice the size of the cache volume in blocks.

When the cache volume that is used by the snapshot reaches the preset highwatermark value, the VERITAS Volume Manager cache daemon, vxcached, is invoked. The values of the highwatermark, autogrowby and maxautogrow attributes for the cache object determine the behavior of vxcached daemon.

  • If the cache usage reaches the highwatermark value and the new required cache size cannot exceed the value of maxautogrow then vxcached grows the size of the cache volume by the size autogrowby.
  • When cache usage reaches the highwatermark value, and the value of the new cache that needs to be created exceeds the value of maxautogrow, then vxcached deletes the oldest snapshot in the cache. If there are several snapshots that have been created during the same time period, then the largest of these is deleted.
  • If the autogrow feature has been disabled for the cache object and the cache usage reaches the highwatermark value, then vxcached deletes the oldest snapshot in the cache. If there are several snapshots that have been created during the same time period, the largest of these is deleted. If there is only a single snapshot, the snapshot is detached and marked as invalid.

For more information on the vxcached daemon or the attributes of the autogrow parameter, refer to the VERITAS Volume Manager Administrator's Guide.

The vxrvg snapshot command also enables you to specify the size for the cache using the cachesize parameter. In this case, a separate cache object is created for every space-optimized snapshot.


Note   Note    If the RVG consists of only VxVM ISP volumes then the cachesize parameter cannot be used.

The steps required to create space-optimized snapshots are as follows:

  • Preparing the RVG volumes for snapshot operation
  • Creating the cache object
  • Freezing or Pausing Replication
  • Taking a space-optimized snapshot
  • Unfreezing or Resuming Replication

Preparing the RVG Volumes for Snapshot Operation

You must prepare the volumes under the RVG for the snapshot operation. For more information on preparing volumes, refer to the section Preparing the Volumes.

Creating the Cache Object

If you intend to create instant space-optimized snapshots then you must create the cache object within the same disk group as the data volumes. Use the vxassist make command to create the cache volume. After creating the cache volume, create the cache object using the vxmake cache command. This command allows you to set the autogrow option for the cache object which allows the cache object to grow automatically, if the size of the cache object is not enough for the incoming writes.

For example, to create the cache volume of size 1GB with a name cache-vol and with a mirrored layout, type the following command on seattle:


 # vxassist -g hrdg make cache-vol 1g layout=mirror init=active

Now, you can create a cache object named cache-obj for the cache volume by typing the following command on seattle:


 # vxmake -g hrdg cache cache-obj cachevolname=cache-vol \
    autogrow=on regionsize=128

However, you can also create the cache object by specifying a value for the cachesize parameter in the vxrvg snapshot command. This command creates one cache object for every space-optimized snapshot. To create one cache object for all the space-optimized snapshots, you must create the cache object using the vxassist make command.

If an RVG consists of only VxVM ISP volumes, then the cachesize parameter cannot be used. In this case, use the vxvoladm command to create an ISP cache object:


  # vxvoladm make <cache_object> <cachesize> type=cachevolume \
      init=active

Freezing or Pausing Replication

For more information on freezing or pausing the replication, refer to Freezing or Pausing Replication.

Creating Instant Space-Optimized Snapshots

To create a space-optimized snapshot for each data volume in an RVG, use the following command:


vxrvg -g diskgroup [-P prefix] -S snapshot rvg_name \
   [instantfull=volume_list [syncing=yes|no]] \
    [exclude=volume_list] [plexbreakoff=volume_list] \
     [plexprefix=plex_prefix]] {cache=cachename|cachesize=size} \
      [comment="<comment>"]
Use the vxrvg snapshot command with its attributes to specify the type of snapshot that you want to create. By default, all the volumes in the RVG are considered for the space-optimized snapshots. To exclude any of the volumes from being considered for the space-optimized snapshots, use one of the following attributes. Depending on the attribute specified with the vxrvg snapshot command, appropriate snapshots of the volumes are created.
The attribute instantso need not be specified when the -S option is specified.
The attribute instantfull specifies a comma-separated list of volumes that need to be included when creating an instant full snapshot of the volumes in an RVG.
The attribute exclude specifies a comma-separated list of volumes that do not need to be considered for any kind of snapshots.
The attribute cache specifies a name for the cache object. However, even if you do not specify a name, you can still specify a size for the cache. The cachesize attribute specifies a default size for the cache object with respect to the source volume. These operations together create one cache object per snapshot volume.

You can specify the volume list for the attributes instantfull, exclude or plexbreakoff when creating the instant space-optimized snapshots. This results in some volumes having an instant full snapshot, some with an instant space-optimized snapshot, some of them with instant plex-breakoff and some being excluded. Any volumes in the RVG that are not specified in the volume_lists of the attributes exclude, plexbreakoff, or instantfull will be snapped in the same way as the specified snapshot type, which is the instant space-optimized snapshot.


Example: Creating Space-Optimized Snapshots

This example describes the steps to create an instant space-optimized snapshot for the specified RVG:

  1. Prepare the required volumes if the volumes have not been prepared already.
    vxsnap -g hrdg prepare hr_dv01 
    vxsnap -g hrdg prepare hr_dv02 

    Perform this operation for all the data volumes in the RVG for which you intend to create snapshots.

  2. You can create the cache volume and the cache object if you want to create all the space-optimized snapshots on a single cache object. To do this, refer to Creating the Cache Object.

    However, if you want to create separate cache objects for each snapshot proceed to the next step. You can create the cache object for each snapshot by specifying the cachesize or cache parameter.

  3. Follow one of the steps provided depending on the method you have chosen for the cache object creation.

    • To create the space-optimized snapshot for the volumes with a precreated cache object, issue the command:

    •    # vxrvg -g hrdg -S -P SO snapshot hr_rvg cache=snap-cacheobj 
    • To create the space-optimized snapshot for the volumes with a separate cache object for each volume, issue the command:

    •    # vxrvg -g hrdg -S -P SO1 snapshot hr_rvg cachesize=10%

        The cache objects are created for each snapshot with cache volumes that are 10% of the source volume. You can also specify an absolute value for the cachesize parameter.


        Note   Note    If the size of the cache volume is less than 5MB, this command will fail.

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 now ready for use.

Instant Plex-breakoff Snapshots

The vxrvg snapshot command creates instant plex-breakoff snapshots of all the volumes in the RVG at a single point in time.

The steps required to create plex-breakoff snapshots are as follows:

  • Preparing the RVG volumes for snapshot operation
  • Creating snapshot plexes for Data Volumes in an RVG
  • Freezing or Pausing Replication
  • Creating an instant plex-breakoff snapshot
  • Unfreezing or Resuming Replication

Preparing the RVG Volumes for Snapshot Operation

It is necessary to prepare the volumes under the RVG for the snapshot operation. For more information on preparing volumes, refer to Preparing the Volumes.

Creating Snapshot Plexes for Data Volumes in an RVG

You must create plexes for the required volumes before you take an instant plex breakoff snapshot.

Use the vxsnap addmir command to add one or more plexes to a volume:


# vxsnap -g diskgroup [-b] addmir volume [nmirror=<N>] \
[attributes...]

Note   Note    Run this command on every data volume in the RVG that needs the plex-breakoff snapshot to be created.

For more information on creating the plexes, refer to the VERITAS Volume Manager Administrator's Guide.

Freezing or Pausing Replication

For more information on freezing or pausing the replication, refer to Freezing or Pausing Replication.

Creating Instant Plex Breakoff Snapshots

The instant plex-breakoff snapshot feature enables you to create plex-breakoff snapshots just like the traditional snapshot feature. This operation cannot be used for an RVG that consists of VxVM ISP volumes.


Prerequisites for creating instant plex breakoff snapshots

    Checkmark  Make sure the volumes for which you want to create plex-breakoff snapshots already have the appropriate plexes created and are in an SNAPDONE state.

    Checkmark  Make sure you create the plexes using appropriate prefixes in case you want to use specific plexes for the snapshot operation.
    For example, <plexprefix>-<volume_name>


    Note   Note    If you do not specify the plexprefix attribute when creating the plex-breakoff snapshots, a plex that is in the SNAPDONE state gets selected, automatically.

To create a plex-breakoff snapshot of each data volume in an RVG, use the following command:


vxrvg -g diskgroup [-P prefix] snapshot rvg_name \
   [instantfull=volume_list [syncing=yes|no]] \
    [instantso=volume_list {cache=cachename|cachesize=size}] \
     [exclude=volume_list] [plexprefix=plex_prefix] \
      [comment="<comment>"]
Use the vxrvg snapshot command with its attributes to specify the type of snapshot that you want to create. This is the default if neither the -S nor the -F option is specified. By default, all the volumes will be included for instant plex breakoff snapshots, provided that they have the plex volumes appropriately created. To exclude any of the volumes, use one of the following attributes. Depending on the attribute specified with the vxrvg snapshot command, appropriate snapshots of the volumes are created.
The attribute exclude specifies a comma-separated list of volumes that do not need to be considered for any kind of snapshot.
The plexprefix attribute specifies a prefix for the plexes that will be used for creating the plex-breakoff snapshots. This is allowed only if the -F or -S option is not specified or if you have specified a list of volumes for creating plex-breakoff volumes with the vxrvg snapshot command.

Example:

This example describes the steps to create an instant plex breakoff snapshot for an RVG:

  1. Prepare the required volumes if they have not been prepared already.
    vxsnap -g hrdg prepare hr_dv01 
  2. If the volumes for which the plex-breakoff snapshots need to be created do not have the required plexes, create them using the following command:
    vxsnap -g hrdg addmir hr_dv01

    Repeat this step for all the required data volumes in the RVG. Initial synchronizing of the plexes may take some time depending on the size of the volume.

    If you need to use specific plexes during the snapshot operation, make sure you name them appropriately when creating them. However, you can also do it later using the following command:


    vxedit -g hrdg rename hr_dv01-02 snapplex-dv01
  3. Use the following command to create snapshots using the specific plex prefixes:
    vxrvg -g hrdg -P JULY snapshot hr_rvg plexprefix=snapplex

    Use the following command to create the snapshots without specifying the plex prefix:

    # vxrvg -g hrdg -P JULY1 snapshot hr_rvg

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 now ready for use.

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   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   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   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   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   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   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:

    • the RLINKs are detached.
    • the attached RLINK in the RVG is in the FAIL state.

  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   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.

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 component volumes of a volume set, the vxrvg snapshot command cannot 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  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:

  • The snapshot volume being used for the resyncfromreplica operation corresponds to the checkpoint to be used in the vxrlink restore command for the RLINK.
  • The checkpoint is still valid before proceeding with the resyncfromreplica snapback operation. Issue the following command to determine whether the checkpoint is still valid:

  • #  vxrlink -g diskgroup cplist rlink_name
  • The snapshot volumes were never written to.

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.

Using VERITAS Volume Manager FastResync

FastResync (FR) enables you to split off a plex from a mirrored volume, manipulate it, and then reattach it to the original volume without doing a complete resynchronization of the volume. FastResync is a separately licensed feature of VxVM.

FR maintains a bitmap of changes to the volume while the plex was split off, and also of changes to the split-off mirror. When the plex is attached, only the blocks represented in the map are resynchronized.

You can use FR to perform the snapback operation after the off-host processing operation is complete.

The operations performed by the vxrvg snapshot and vxrvg snapback commands are based on one of the following conditions:

  • If you do not have an FR license, the vxrvg snapshot command creates a simple snapshot without any FR bitmaps. A vxrvg snapback operation then results in a full resynchronization of the plexes.
  • If you have an FR license and FastResync is enabled on the volumes, but no DCO logs are attached to the data volumes, the vxrvg snapshot command creates a snapshot with a non-persistent FR bitmap. A vxrvg snapback operation performs a FastResync, but if the system reboots at any time after the snapshot operation, the information in the FR bitmap is lost and a full resynchronization takes place.
  • If you have an FR license, FastResync is enabled, and DCO logs are attached to the data volumes, the vxrvg snapshot command creates a snapshot with persistent FR bitmap. A vxrvg snapback operation performs a FastResync even if the system reboots at any point in time after the snapshot operation.

For more information on Persistent and Non-Persistent FR, see the VERITAS Volume Manager Administrator's Guide.

Enabling FastResync

To enable FR on a data volume, type:


  # vxvol -g diskgroup set fmr=on dv_name
Do this for all the data volumes in the RVG that you want to access.

Refer to the VERITAS Volume Manager Administrator's Guide for more information.

 ^ Return to Top Previous  |  Next  >  
Product: Volume Replicator Guides  
Manual: Volume Replicator 4.1 Administrator's Guide  
VERITAS Software Corporation
www.veritas.com