Symantec logo

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.

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