snapshot command creates an instant space-optimized snapshot of all the volumes in the RVG at a single point in time. The
snapshot command creates the same type of snapshots as the
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
The values of the
maxautogrow attributes can be set when a cache object is created using
vxmake. If necessary, you can use the
set command to change the values of these attributes for an existing cache. The default value for these attributes is as follows:
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
maxautogrow attributes for the cache object determine the behavior of
highwatermarkvalue and the new required cache size cannot exceed the value of
vxcachedgrows the size of the cache volume by the size
highwatermarkvalue, and the value of the new cache that needs to be created exceeds the value of
vxcacheddeletes 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.
vxcacheddeletes 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.
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.
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:
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.
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
make command to create the cache volume. After creating the cache volume, create the cache object using the
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
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
vxmake -g hrdg cache cache-obj cachevolname=cache-vol \
However, you can also create the cache object by specifying a value for the
cachesize parameter in the
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
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 \
For more information on freezing or pausing the replication, refer to Freezing or pausing replication.
To create a space-optimized snapshot for each data volume in an RVG, use the following command:
vxrvg -g diskgroup [-P
] -S snapshot
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
snapshot command, appropriate snapshots of the volumes are created.
instantso need not be specified when the
-S option is specified.
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.
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
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
Example: Creating space-optimized snapshots
This example describes the steps to create an instant space-optimized snapshot for the specified RVG:
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.
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
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.