Symantec logo

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


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