< Previous | Next > | |
Product: Volume Replicator Guides | |
Manual: Volume Replicator 4.1 Administrator's Guide |
Creating RVG SnapshotsVVR 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 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 FeatureVVR 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. 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 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:
Note If the RVG consists of VxVM ISP volumes then VVR supports only the instant full snapshot and instant space-optimized snapshot operations. Instant Full SnapshotThe 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 You must create and prepare the snapshot volumes before they can be used for creating snapshots. Prerequisites for creating instant full snapshots Make sure you create the snapshot volumes and then prepare them before creating the snapshots. Make sure the snapshot volumes are the same size as the original volumes. 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 RVGYou 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 VolumesTo 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 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 ReplicationBefore 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 SnapshotsUse 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, plexbreakoff, or 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). 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. This example describes the steps to create an instant full snapshot for an RVG:
Unfreezing or Resuming ReplicationAfter 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 SnapshotsThe 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:
Default value is 20% of 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.
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 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 OperationYou 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 ObjectIf 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 ReplicationFor more information on freezing or pausing the replication, refer to Freezing or Pausing Replication. Creating Instant Space-Optimized SnapshotsTo 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:
Unfreezing or Resuming ReplicationAfter 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 SnapshotsThe 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 OperationIt 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 RVGYou 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 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 ReplicationFor more information on freezing or pausing the replication, refer to Freezing or Pausing Replication. Creating Instant Plex Breakoff SnapshotsThe 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 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.
Make sure you create the plexes using appropriate prefixes in case you want to use specific plexes for the snapshot operation. 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. This example describes the steps to create an instant plex breakoff snapshot for an RVG:
Unfreezing or Resuming ReplicationAfter 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 SnapshotsRefreshing SnapshotsThe 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 SnapshotsUse 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. 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.
The restore operation is allowed only if:
To restore the snapshots on the Primary
Displaying the Snapshot InformationThe 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 SnapshotsThe 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 FeatureThis 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 RVGTo 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 ReplicationBefore 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 SnapshotThe 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 ReplicationAfter 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 SnapshotUse 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 OptionThe 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:
# vxrlink -g diskgroup cplist rlink_name 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 FastResyncFastResync (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:
For more information on Persistent and Non-Persistent FR, see the VERITAS Volume Manager Administrator's Guide. Enabling FastResyncTo 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 |