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.
snapshot command creates the data volume snapshots for all the volumes in the RVG, similar to the ones created by the
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:
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
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.
Upgrading the disk group
To use the instant snapshot feature, the disk groups must be version 110 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
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
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
For more information on the
prepare command, refer to the Veritas Volume Manager Administrator's Guide.
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:
Refer to the README file in this directory for instructions on how to use the sample scripts to create the instant 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
] [syncing=yes|no] [comment="<comment>"]
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
snapshot command, the appropriate snapshots of the volumes are created.
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.
exclude specifies a comma-separated list of volumes that do not need to be considered for any kind of snapshots.
instantso specifies a comma-separated list of volumes that can be included for instant space-optimized snapshots when taking the instant full snapshots.
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
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
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
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
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.
-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:
vxprint -g hrdg -F"%name %len" hr_dv01 hr_dv02
vxprint -g hrdg -F"%name %len" 'vxrvg getdatavols hr_rvg'
vxsnap -g hrdg prepare hr_dv01
vxsnap -g hrdg prepare hr_dv02
Note Make sure that all the applications running on these volumes are closed.
vxassist -g hrdg make JUNE-hr_dv01 20971520
vxassist -g hrdg make JUNE-hr_dv02 20971520
vxsnap -g hrdg prepare JUNE-hr_dv01
vxsnap -g hrdg prepare JUNE-hr_dv02
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.
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.
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.
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.