vxsnap (1M)

NAME

vxsnap - enable DRL on a volume, and create and administer instant snapshots

SYNOPSIS

vxsnap [-g diskgroup] addmap volume number [alloc=storage_attributes]

vxsnap [-g diskgroup] addmir {volume|volset} [nmirror=N] [attributes ...]

vxsnap [-b] [-g diskgroup] addmir {volume|volset}
    mirvol={mirror_volume|mirror_volset} [mirdg=diskgroup] [attributes ...]

vxsnap [-f] [-g diskgroup] dis {volume|volset}

vxsnap [-g diskgroup] [-B] [-l] [-v] [-x]
    list [{volume|volset}]

vxsnap [-g diskgroup] [-o optarg[,optarg]...] make
    snapshot_tuple [snapshot_tuple]...
    [alloc=storage_attributes] [comment=\"comment\"]

vxsnap -d description_file [-g diskgroup]
    [-o optarg[,optarg]...] make
    [alloc=storage_attributes] [comment=\"comment\"]

vxsnap [-g diskgroup] [-o optarg[,optarg]...] make -

vxsnap [-g diskgroup] prepare
    {volume|volset} [regionsize=size]
    [drl={yes|no|sequential}]
    [ndcomirs=number]
    [alloc=storage_attributes] [mirror=class]

vxsnap [-g diskgroup] [{-e | -m | -n [-B] [-l] [-v] [-x]}]
    print [{volume|volset}]

vxsnap [-f] [-g diskgroup] reattach
    {snapvol|snapvolset} source={volume|volset}
    [nmirror=number] [sourcedg=diskgroup]

vxsnap [-g diskgroup] [-o optarg[,optarg]...] refresh
    {snapvol|snapvolset} source={volume|volset}
    [[{snapvol|snapvolset} source={volume|volset}]...]
    [syncing=yes|no]

vxsnap [-g diskgroup] [-o optarg[,optarg]...] restore
    {volume|volset} source={snapvol|snapvolset}
    [{volume|volset} source={snapvol|snapvolset}]...
    [destroy=yes|no] [syncing=yes|no] [nmirror=number]

vxsnap [-g diskgroup] rmmir {volume|volset}

vxsnap [-g diskgroup] rmmir {volume|volset}
    mirvol={mirror_volume|mirror_volset} [mirdg=diskgroup]

vxsnap [-g diskgroup] snapwait {volume|volset} {plex=plex1[,plex2]... |
    nmirror=N | mirvol={mirror_volume|mirror_volset} | nmirvol=N} [mirdg=diskgroup]

vxsnap [-f] [-g diskgroup] split {volume|volset}

vxsnap [-g diskgroup] syncpause {volume|volset}

vxsnap [-g diskgroup] syncresume {volume|volset}

vxsnap [-b] [-g diskgroup] [-o optarg[,optarg]...]
    [-t tasktag] syncstart {volume|volset}

vxsnap [-g diskgroup] syncstop {volume|volset}

vxsnap [-g diskgroup] syncwait {volume|volset}

vxsnap [-g diskgroup] unprepare {volume|volset}

DESCRIPTION

The vxsnap command is used to associate a version 20 data change object (DCO) and DCO volume with a volume. A DCO volume allows dirty region logging (DRL; used for fast mirror recovery) to be used with a volume. It also allows full-sized and space-optimized instant snapshots to be created and administered for a volume.

Full-sized instant snapshots, like traditional third-mirror snapshots, requires as much storage space for each of their plexes as a plex in the parent volume. Unlike traditional snapshots, however, instant snapshots are immediately available for use on being created. Synchronization of the snapshot volume can be performed in the background, or deferred until synchronization is necessary to dissociate the snapshot volume from its parent volume, or to move it into a separate disk group for off-host processing.

Space-optimized instant snapshots are also immediately available for use on being created, but they are typically configured to use a fraction of the storage space that is required by full-sized instant snapshots.

KEYWORDS

addmap Adds a number of per-volume maps to the DCO volume of the specified volume. This may be necessary if no maps are available for use in the DCO volume. (By default, a DCO volume contains 32 per-volume maps.) The disks that are to be used for the maps may be specified as a list of comma-separated storage_attribute arguments.
addmir Adds one or more mirrors to a volume for use in creating third-mirror break-off snapshots. (This operation is similar to the vxassist snapstart command.)
The number of mirrors to be added may be specified by using the nmirror attribute. The default number is 1.
This command also adds an equal number of mirrors to the DCO volume, and creates an association between each data mirror and a DCO mirror. When a data mirror is broken off to take a snapshot, the corresponding DCO mirror accompanies it. You can use storage attributes to control the allocation of disk space to the mirrors.
The newly created data plexes remain in the SNAPATT state until they have been fully synchronized from the original data plexes. Synchronization is carried out as a background task if the -b option is specified. Once the data plexes have been fully synchronized, they are placed in the SNAPDONE state. The state of the DCO plexes is DCOSNP until they are associated with the DCO of the original volume.
Alternatively, the name of a suitably sized volume or volume set that is to be used as a snapshot volume can be specified using the mirvol attribute. This establishes a link between the data volume and the snapshot volume. If the snapshot volume exists in a different disk group, this disk group is specified using the mirdg attribute. Note that the snapshot is not ready for use until synchronization is complete.
The state of the link can be viewed by using the vxprint command. This state must change from ATTACHING to ACTIVE before the snapshot can be created. If the -b option was specified, you can use the vxsnap snapwait to wait for the link to the snapshot volume or snapshot volume set to become ACTIVE. The vxsnap make command can then be run to create a break-off snapshot volume or volume set.
The volume (and mirvol, if specified) must have been prepared using vxnap prepare for this command to succeed.
dis Dissociates an instant snapshot volume from its parent volume, and removes it from the snapshot hierarchy. The parent volume of the snapshot volume adopts any snapshot hierarchy that exists beneath the snapshot volume.
This operation fails if the snapshot volume has any unsynchronized child snapshots immediately below it in a snapshot hierarchy.
Note: A snapshot volume must be dissociated from its snapshot hierarchy before it can be deleted by using a command such as vxedit rm.
Note: When applied to a volume set or to a component volume of a volume set, this operation can result in inconsistencies in the snapshot hierarchy in the case of a system crash or hardware failure. If the operation is applied to a volume set, the -f (force) option must be specified.
list Displays information about volumes or volume sets and their instant snapshots. The vxsnap list command is an alias for the vxsnap -n print command. For details, see the descriptions of the print keyword and -n option.
make Creates full-sized or space-optimized instant snapshot volumes.
Each snapshot that is to be created is defined by a snapshot tuple, snapshot_tuple. A tuple consists of a number of attribute=value fields. Within each tuple, the fields are separated by slashes (/).
The following attributes can be defined for snapshot tuples. All attributes are optional except where specified.
alloc=storage_attributes
  Specifies a comma-separated list of storage attributes (disks, controllers, enclosures, trays and sites) from which storage for the snapshot volume (and any required cache object) is to be allocated.
See the vxassist(1M) manual page for more information about storage attributes. (Note that such attributes are silently ignored if they do not apply or are not required.)
autogrow={yes|no}
  Specifies whether the dedicated (non-shared) cache that is associated with a space-optimized snapshot can be grown automatically when extra space is required. The default value is yes.
This attribute does not apply to full-sized instant snapshots.
See the vxcached(1M) manual page for more information on the operation of the autogrow feature.
cache=cache_object
  Specifies the name of the cache object to be used by a space-optimized snapshot. The named cache object can be one shared between several space-optimized snapshots within the same disk group, or it can be a cache object that is dedicated for use by a single snapshot.
Note: The cache object must already exist.
cachesize=size
  Specifies the size of the cache to be created for use by a space-optimized snapshot. The minimum cache size is approximately 10m (10MB) plus 1MB for each 256KB of the region size.
comment=\"comment\"
  Associates a description with the snapshot volume.
The double quotation marks around the comment string must be escaped with backslashes to protect them from the shell. The comment itself must not contain double quotation marks.
infrontof=frontvol
  Places a volume in front of the specified volume, frontvol, in a snapshot cascade.
Note: Snapshot cascades improve write performance for applications that take regular online snapshots of volumes. They are not suitable for use where the snapshots may be dissociated from the snapshot hierarchy.
ncachemirror=number
  Specifies the degree of redundancy to be configured in the cache volume that underlies the cache object. By default, an unmirrored cache volume is created (ncachemirror=1).
This attribute does not apply to full-sized instant snapshots. It cannot be specified with the cache attribute.
newvol={snapvol|snapvolset}
new={snapvol|snapvolset}
  Specifies the name of the new space-optimized or full-sized break-off snapshot volume that is to be created. If not specified, the snapshot is assigned a name of the form SNAP%d-%v, where %d is a unique serial number, and %v is the name of the original volume. You can use the -o name="pattern" option to specify a different format to use for new snapshot volumes.
new is an alias for newvol.
Note: For a full-sized break-off snapshot volume, either the plex or the nmirror attribute must also be specified.
nmirror=number
nmirrors=number
  Specifies the degree of redundancy to be configured in a snapshot volume by the make operation. By default, an unmirrored snapshot volume is created (nmirror=1).
This attribute is also used to specify the number of snapshot mirrors that are to be added to a volume in the addmir operation. By default, one snapshot mirror is added to a volume (nmirror=1).
If the newvol attribute is specified to the make operation instead of the snapvol attribute, nmirror specifies the number of plexes in the original volume that are to be broken off for use as snapshot plexes.
nmirrors is an alias for nmirror.
Note: The original volume must have a mirror or mirror-stripe layout, or it must be a RAID-5 volume that has been converted to a layered layout by running the vxsnap prepare command. The volume must also have a sufficient number of plexes available that are in the SNAPDONE state (see the description of vxsnap addmir).
This attribute only applies to full-sized break-off mirror snapshots. It can also be used when creating snapshots of volume sets. It cannot be specified with the plex attribute.
plex=plex[,plex...]
  Specifies one or more plexes in the original volume that are to be used as snapshot plexes.
Note: The data in the plexes must already be synchronized, and the plexes must be in the ACTIVE state.
This attribute applies only to full-sized break-off snapshots. It cannot be specified with the nmirror attribute.
snapdg=diskgroup
  Specifies the disk group that contains a linked break-off snapshot volume if this is different from the diskgroup containing the data volume. This attribute applies only to linked break-off snapshot volumes or volume sets that have been linked to the data volume using the addmir operation with the mirvol attribute specified.
snapvol=volume
snap=volume
  Specifies a volume that is to be used as a full-sized snapshot of the source volume. The specified volume must have the same length as the source volume. The region size of the DCO volume of the snapshot volume must also be the same as that of the DCO volume of the source volume.
snap is an alias for snapvol.
This attribute applies only to full-sized snapshots that are created on a pre-prepared volume, and to linked break-off snapshots that are created from mirrors that have been added by using the mirvol with the addmir operation. It cannot be specified with the newvol attribute.
source=volume
  Specifies the name of the volume for which the snapshot is being taken.
syncing={off|no|on|yes}
sync={off|no|on|yes}
  Specifies whether synchronization is to be started for a full-sized instant snapshot (default value is on).
sync is an alias for syncing.
The value off is equivalent to no, and on is equivalent to yes.
Note: An instant snapshot must be fully synchronized before the dis or split operations can be performed on it, or before it can be moved into a separate disk group. To reduce system overhead, synchronization may be disabled if the snapshot volume is to remain dependent on the original volume in the same disk group.
This attribute applies only to full-sized instant snapshots.
To summarize, the following options must be specified for the different types of instant snapshot:
o Space-optimized on a newly created cache (volumes only): source, cachesize, and newvol or new.
o Space-optimized on a pre-prepared cache: source, cache, newvol or new.
o Full-sized break-off (volumes only): source, newvol or new, and nmirror or plex.
o Full-sized on a pre-prepared volume: source, and snapvol or snap.
The autogrow option applies only to space-optimized snapshots, and the ncachemirror option applies only to space-optimized snapshots for which a cache is created at the same time.
The syncing option applies only to full-sized instant snapshots.
The alloc, comment and infrontof attributes may optionally be specified for all instant snapshots.
The following global attributes may be specified at the end of the command and are applied to all snapshots that are to be created:
alloc=attributes
  Specifies a comma-separated list of storage attributes (disks, controllers, enclosures, trays and sites) from which storage for the snapshot volumes (and any required cache objects) is to be allocated.
comment=\"comment\"
  Associates a description with all the snapshot volumes.
The double quotation marks around the comment string must be escaped with backslashes to protect them from the shell. The comment itself must not contain double quotation marks.
The make command also enables FastResync on the snapshot, and sets the instant flag to indicate that it is ready for access. For full-sized instant snapshots, the incomplete flag is also set to indicate that the snapshot has not been fully synchronized with its parent volume. The incomplete flag is unset when synchronization (if any) is complete. You can check for these flags using the vxprint command as shown here:

vxprint -g diskgroup -F %instant volume vxprint -g diskgroup -F %incomplete volume

The returned value indicates whether the flag is set (on) or not set (off).
If the argument to make is a dash character (-), snapshot tuple arguments and other attributes are read from the standard input.
prepare Prepares a volume for instant snapshot and space-optimized snapshot operations, and for dirty region logging (DRL). A new-style data change object (DCO) and DCO volume are associated with the volume.
Note: If an old-style DRL log or DCO is present on the volume, the operation fails. These must be removed from the volume before instant snapshots can be used.
If the volume is RAID-5, it is converted into a layered volume with mirroring at the top layer and the original RAID-5 volume in the lower layer. This volume cannot be resized nor can its layout be changed unless the unprepare operation is used to convert it back to a non-layered RAID-5 volume.
The size of DCO volume is determined by the size of each volume region that is mapped by a single bit in a FastResync map, and by the number of mirrors in the DCO volume. By default, each mirror requires space for 32 per-volume maps plus an accumulator and DRL log that require an additional amount of space that is equivalent to 3 per-volume maps.
The number of mirrors in the DCO volume may be specified by the ndcomirs attribute. For non-layered volumes, the default number of DCO mirrors is set to the lesser of the number of data plexes in the parent volume or 2. For layered volumes, the default number of DCO mirrors is set to 2.
Note: It is recommended that you give the DCO volume the same level of redundancy as the parent volume.
The default region size is 64k (64KB). If a different region size is specified by using the regionsize attribute, this must be a power of 2 and greater than or equal to 16k. regionsz is an alias for regionsize.
The value of the drl attribute specifies how DRL is to be applied to the volume:
no DRL is not enabled on the volume.
sequential Sequential DRL is enabled on the volume.
yes DRL is enabled on the volume.
The instant flag is set on the volume to indicate that the volume can be used for instant snapshot operations.
The alloc attribute specifies a comma-separated list of storage attributes (disks, controllers, enclosures, trays and sites) from which storage for the snapshot volume (and any required cache object) is to be allocated. The attributes can be in the form [!]diskclass[:instance] or [!]diskname or diskclass:same.
See the vxassist(1M) manual page for more information about storage attributes and classes. (Note that such attributes are silently ignored if they do not apply or are not required.)
The mirror=class attribute constrains the selection of disks so that the mirrors are created on disks with different values with respect to the specified class.
print Displays information about volumes or volume sets and their instant snapshots. Several different output formats are available corresponding to the -e (default), -m and -n options together with modifier options.
When applied to a volume (or volume set), details of all its snapshots are output. For a snapshot, details of its parent are also displayed.
If no argument is specified, the command displays snapshot-related information for all volumes in a disk group with the default format (equivalent to specifying the -e option).
reattach Reattaches the plexes of a snapshot volume to the specified source volume in a snapshot hierarchy, and synchronizes them from that volume. The DCO plexes that are associated with the plexes being reattached are also reassociated with the DCO volume of the source volume.
The reattach operation can also be used to re-establish the link between a snapshot volume and the data volume that was previously created using the mirvol attribute to the vxsnap addmir command. If the source data volume is in a different disk group from the snapshot volume, this disk group can be specified using the sourcedg attribute.
Note: The reattach operation is permitted between unrelated volumes provided that their sizes are compatible.
Note: The reattach operation is not supported for space-optimized snapshots.
The plexes of the snapshot volume are put into the SNAPTMP state while they are being synchronized, and are set to the ACTIVE state when synchronization is complete.
By default, all the plexes of the snapshot volume are reattached. The nmirror attribute can be used to return a subset of the plexes in the snapshot volume.
refresh Refreshes a snapshot volume from the specified source volume. The snapshot volume is immediately available with the new contents. By default, synchronization of the snapshot volume is started. If you require that synchronization should not be started, specify the syncing=no attribute.
Note: The snapshot volume must be closed (for example, it must not be mounted as a file system, or be accessed by a database or other application) before running this command. However, the snapshot volume may be re-opened immediately after running this command.
Note: The refresh operation is permitted between unrelated volumes provided that their sizes are compatible.
restore Restores one or more volumes from the specified source snapshot volumes. The volume is immediately available with the new contents, and synchronization of the volume is started unconditionally.
Note: This operation is not permitted between unrelated volumes.
By default, full synchronization is started unless the syncing=no attribute is specified.
If the destroy attribute is set to yes, the snap volume is removed when the synchronization is complete, and its plexes are attached to the parent volume. By default, the destroy attribute is set to no, which preserves the snapshot volume. Only non-destructive restoration is possible for space-optimized snapshots as these do not have complete plexes.
The incomplete and restore flags are set on the volume while it is being restored.
Note: The volume must be closed (for example, it must not be mounted as a file system, or be accessed by a database or other application) before running this command. However, the volume may be re-opened immediately after running this command, before synchronization is complete.
rmmir Removes one snapshot mirror that was previously added to a volume by using the vxsnap addmir command. (This operation is similar to the vxassist snapabort command.) The DCO plex that is associated with the mirror is also removed.
If the addmir operation was used to link a separate volume for use as a linked break-off snapshot, this volume can be unlinked by specifying its name to the mirvol attribute. If different from the disk group containing the data volume, the disk group containing the snapshot volume is specified using the mirdg attribute.
The command fails if no such mirror exists, or if the specified volume has not been prepared for use with instant snapshots.
snapwait Waits for newly linked break-off snapshot volumes or volume sets to become ACTIVE, or for reattached snapshot plexes to reach the SNAPDONE state following resynchronization.
The plex attribute specifies which plexes to wait for becoming SNAPDONE. This attribute cannot be used with volume sets.
The nmirror attribute specifies how many plexes to wait for becoming SNAPDONE. When used with volume sets, each component volume must have N SNAPDONE plexes.
The mirvol attribute specifies which linked volume or volume set to wait for becoming ACTIVE.
The nmirvol attribute specifies how many linked volumes or volume sets to wait for to becoming ACTIVE. When used with volume sets, all the component volumes in a volume set must be in the ACTIVE state.
The mirdg attribute specifies the disk group containing the snapshot volume if this is different from the disk group containing the data volume.
split Splits a snapshot hierarchy into two independent snapshot hierarchies. The per-volume map for this volume in its parent volume is deactivated, and the linking snap objects are removed from both the volume and its parent.
Note: This operation is not supported for space-optimized snapshots.
The specified volume and its descendents form an independent snapshot hierarchy. This requires that synchronization of the volume is complete.
As a result of this operation, the volume is dissociated from its parent. The operation fails if the volume is dependent on its parent.
Note: When applied to a volume set or to a component volume of a volume set, this operation can result in inconsistencies in the snapshot hierarchy in the case of a system crash or hardware failure. If the operation is applied to a volume set, the -f (force) option must be specified.
syncpause Pauses a synchronization operation that is in progress.
syncresume Resumes a synchronization operation that was paused by the syncpause command.
syncstart Starts synchronization of an instant snapshot. This command checks that the incomplete flag is set on the snapshot, and removes this flag when synchronization is complete.
Resynchronization must not have been started earlier by the make command (by specifying syncing=yes), or stopped by the syncstop command.
The command returns immediately if synchronization is in progress, or if synchronization is already complete (that is, the incomplete flag is not set).
Note: The vxtask command can be used to pause, resume, or stop the synchronization operation.
syncstop Stops synchronization of an instant snapshot. The command returns immediately if no synchronization is in progress, or if synchronization is already complete (that is, the incomplete flag is not set).
syncwait Waits for synchronization to complete on the specified volume. This command works by periodically checking for the incomplete flag to be removed from the volume.
This command cannot be used to wait for reattached plexes to be resynchronized. Use the snapwait operation for this purpose.
The command fails for a space-optimized snapshot, or for a snapshot on which synchronization is not in progress.
unprepare Removes the DCO and DCO volume that are associated with a volume. This disables DRL, FastResync and instant snapshot functionality for the volume, and unsets the instant flag on the volume.
If the volume is part of a snapshot hierarchy, the operation fails. Use the dis operation to remove the volume from the snapshot hierarchy before using this command.
If the volume was originally a RAID-5 volume that was converted to a layered volume by the prepare command, the layout reverts to non-layered RAID-5.

OPTIONS

-b Performs any necessary synchronization in the background, instead of blocking. This option only applies to the syncstart operation.
-B When used with the -n option, prints the number of 512-byte blocks instead of percentages.
-d description_file
  When used with the make operation, allows tuple definitions to be read from a description file instead of from the command line. The tuples may be placed on separate lines in this file.
-e When used with the print operation, displays the volume name, snap object name, volume or snapshot type, parent volume name, snapshot name, percentage change between the contents of a snapshot and its parent (%DIRTY), and the percentage progress in synchronization of a snapshot (%VALID).
This is the default option to vxsnap print, and corresponds to the standard output format from previous releases.
-g diskgroup Specifies the disk group for the operation, either by disk group ID or by disk group name. If this option is not specified, the default disk group is determined using the rules given in the vxdg(1M) manual page.
-l When used with the -n option, prints information in long format rather than the default tabular format.
-m When used with the print operation, displays detailed information about a volume’s DCO including the name of the volume, the region size, the number of regions represented by each map, and the number of per volume maps.
-n When used with the print operation, displays extended information including the volume name, disk group name, object type, snapshot type, parent volume name, parent disk group name and snapshot date. Additional columns are available if the -v option is specified.
The following object types may be displayed:
compvol Component volume of a volume set.
plex Plex.
vol Volume.
vset Volume set.
The following snapshot types may be displayed:
detmir Detached snapshot plex.
detvol Detached snapshot mirror volume.
fullinst Full-sized instant snapshot.
mirbrk Plex break-off snapshot.
mirvol Snapshot mirror volume that was added using the addmir operation with the mirvol attribute specified.
snapmir Snapshot plex that was added using the addmir operation.
spaceopt Space-optimized snapshot.
volbrk Break-off snapshot that was created on a pre-prepared mirvol.
The -B, -l, -v and -x options can be used to change the information displayed by the -n option.
-o optarg[,optarg]...]
  Specifies arguments that alter the behavior of the make operation. The following arguments may be specified:
iosize=size
  Specifies the size of each I/O request that is to be used when synchronizing the regions of the volume. This option may be specified with the addmir, make, refresh, restore and syncstart operations. The specified value is rounded to a multiple of the volume’s region size. The default value is 1m (1MB).
name="pattern"
  Specifies a format template for naming new snapshot volumes. This option may be used with the make operation. The pattern consists of characters and one or more of the following specifiers:
%% Single percent character.
%d Unique serialization number expressed as a decimal integer.
%g Disk group name.
%m Mirror’s original name.
%s Serialization string expressed as a sequence of one or more lower case letters.
%S Serialization string expressed as a sequence of one or more upper case letters.
%v Volume name.
%x Unique serialization number expressed as a lower-case hexadecimal integer.
%X Unique serialization number expressed as an upper case hexadecimal integer.
site=sitename
  When used with the make operation, specifies that snapshots are to be taken for the named site of all volumes on which the allsites=on attribute is set.
Full-sized break-off snapshot volumes are created for all volumes in the disk group that have a complete plex available at the named site. For this reason, it is not necessary to use the source, snapvol or newvol commands to specify the source volume or the target volume in the snapshot tuple. Instead, the -o name=pattern option is used to generate names for the snapshot volumes.
The site:sitename2 storage allocation attribute can be used to specify storage at a different site.
slow=iodelay
  Specifies the delay in milliseconds between synchronizing successive sets of regions as specified by the value of iosize. This can be used to change the impact of synchronization on system performance. This option may be specified with the make, refresh, restore and syncstart operations. The default value of iodelay is 0 milliseconds (no delay).
-t tasktag When used with the syncstart operation, defines a tag that can be used to track the synchronization task. The specified tag is a sequence of up to 16 alphanumeric characters.
-v When used with the -n option, prints additional information about the absolute and percentage difference in data content between a snapshot volume and its parent (that is, the amount of data that would have to be synchronized to make the contents identical), and the absolute and percentage amount of data synchronized in the snapshot volume or mirror.
-x When used with the -n option, expands the output to include the component volumes of volume sets.

EXAMPLES

Create a volume, fsssvolx, with 2 mirrors that is to be used as the full-sized snapshot of the volume, volx:

LEN=‘vxprint -g mydg -F%len volx‘ vxassist -g mydg -b make fsssvolx $LEN layout=mirror nmirror=2 DCOVOL=‘vxprint -g mydg -F%dconame volx‘ RSZ=‘vxprint -g mydg -F%regionsz $DCOVOL‘ vxsnap -g mydg prepare volume regionsize=$RSZ ndcomirs=2

The vxprint commands are used to discover the length of the original volume, the name of its DCO volume, and the region size of that DCO volume. The vxassist command is used to create a new volume with the required redundancy. Finally, the vxsnap prepare command sets up a DCO volume with the correct region size on the newly created volume.

Having performed the previous steps, the full-sized instant snapshot can be created (this example also starts synchronization using an I/O size of 10MB):


vxsnap -g mydg -o iosize=10m make source=volx/snapvol=fsssvolx/sync=yes

Add 2 mirror plexes to the volume vol1 for use as break-off snapshots:


vxsnap -g mydg addmir vol1 nmirror=2

Remove one snapshot mirror plex from the volume vol1:


vxsnap -g mydg rmmir vol1

Create full-sized instant snapshots of volumes vol1, vol2 and vol3 with specified names by breaking off one plex from each original volume:


vxsnap -g mydg make source=vol1/newvol=snapvol1/nmirror=1 \   source=vol2/newvol=snapvol2/nmirror=1 \   source=vol3/newvol=snapvol3/nmirror=1

Create a space-optimized snapshot, sossvolx, of the volume, volx, and also set up a 1GB growable cache for use by the snapshot:


vxsnap -g mydg make \   source=volx/newvol=sossvolx/cachesize=1g/autogrow=yes

Use the vxassist command to create a 20GB cache volume, mydgcvol, with 2 mirrors:


vxassist -g mydg -b make mydgcvol 20g layout=mirror nmirror=2

Use the vxmake command to set the region size of mydgcvol to 32KB, and to associate the volume with the cache object, mydgcache, for use by space-optimized snapshots in the disk group, mydg:


vxmake -g mydg cache mydgcache cachevolname=mydgcvol regionsize=32k

Use the vxcache command to start the cache:


vxcache -g mydg start mydgcache

Create space-optimized snapshots of volumes vol1, vol2 and vol3 with a mixture of default and specified names. Default snapshot names are assigned using the specified template. Each snapshot shares the prepared cache, mydgcache:


vxsnap -g mydg -o name="so%v-%d" make \   source=vol1/cache=mydgcache \   source=vol2/newvol=sosnapvol2/cache=mydgcache \   source=vol3/cache=mydgcache

Create a space-optimized snapshot, sossvoly, of the volume, voly, on the cache, mydgcache:


vxsnap -g mydg make \   source=voly/newvol=sossvoly/cache=mydgcache

Create a space-optimized snapshot, sos2voly, of the volume, voly, and place this in front of snapshot, sossvoly, to create a snapshot cascade:


vxsnap -g mydg make \   source=voly/newvol=sos2voly/infrontof=sossvoly/cache=mydgcache

Refresh the contents of the full-sized snapshot, snapvol1, and the spaced-optimized snapshot, sosnapvol2, from their original volumes, using an I/O size of 5MB:


vxsnap -g mydg -o iosize=5m refresh snapvol1 sosnapvol2

Synchronize the contents of the full-sized snapshot volume, snapvol2, from its original volume using an I/O size of 10MB, wait for the synchronization to complete, and then turn snapvol2 into an independent volume:


vxsnap -g mydg -b -o iosize=10m syncstart snapvol2 vxsnap -g mydg syncwait snapvol2 vxsnap -g mydg dis snapvol2

Reattach the full-sized snapshot, snapvol1, to its original volume:


vxsnap -g mydg reattach snapvol1 source=vol1

Restore vol3 from the full-sized snapshot volume, snapvol3, using an I/O size of 2MB, and remove the snapshot volume when restoration is complete:


vxsnap -g mydg -o iosize=2m restore vol3 source=snapvol3 destroy=yes

Add the prepared volume, prepsnap, in the disk group, mysnapdg, to the volume vol4 for use as a linked break-off snapshot:


vxsnap -g mydg -b addmir vol4 mirvol=prepsnap mirdg=mysnapdg

Wait for synchronization of the linked volume, prepsnap, from the previous example, to complete (note that the mirror disk group must also be specified):


vxsnap -g mydg snapwait vol4 mirvol=prepsnap mirdg=mysnapdg

Take a snapshot of vol4, using the linked break-off snapshot volume, prepsnap, in the disk group, mysnapdg:


vxsnap -g mydg make source=vol4/snapvol=prepsnap/snapdg=mysnapdg

Reattach the link between the volumes, prepsnap and vol4:


vxsnap -g mysnapdg reattach prepsnap source=vol4 sourcedg=mydg

If the linked break-off snapshot is created in the same disk group as its parent volume, the previous four commands can be simplified as follows:

vxsnap -g mydg -b addmir vol4 mirvol=prepsnap vxsnap -g mydg snapwait vol4 mirvol=prepsnap vxsnap -g mydg make source=vol4/snapvol=prepsnap vxsnap -g mydg reattach prepsnap source=vol4

To prepare a volume for snapshot operations by creating a DCO volume on solid state devices (SSD) storage, use the following command:


vxsnap -g testdg prepare tvol alloc=mediatype:ssd

To create a full-size instant snapshot using SSD storage, use:


vxsnap -g testdg make source=tvol/newvol=snapvol alloc=mediatype:ssd

NOTES

If a valid FlashSnap(TM) license for FastResync is not present on the system, the prepare operation turns on dirty region logging (DRL) but not FastResync for a volume.

If FastResync is turned off, the addmir, dis (for leaf nodes only), make (for break-off snapshots only), print, reattach, rmmir, and split operations are permitted. The reattach operation requires a full resynchronization.

The refresh and restore operations, and the creation using make of full-sized or space-optimized instant snapshots are not permitted if FastResync is turned off.

A volume that is a member of a snapshot hierarchy must be dissociated from the hierarchy before FastResync can be enabled or disabled on the volume (using the vxvol set fastresync=on command).

When using the vxsnap prepare or vxassist make commands to make a volume ready for instant snapshot operations, if the specified region size exceeds half the value of the tunable voliomem_maxpool_sz, the operation succeeds but gives a warning such as the following (for a system where voliomem_maxpool_sz is set to 12MB):


Specified region-size is larger than the limit on the system (voliomem_maxpool_sz/2=6144k).

vxsnap make operations to create full-sized or space-optimized instant snapshots, and refresh and restore operations on such volumes fail as they might potentially hang the system. Such volumes can be used only for breakoff-type snapshot operations using the reattach and make operations.

To make the volumes usable for instant snapshot operations, use vxsnap unprepare on the volume, and then use vxsnap prepare to re-prepare the volume with a region size that is less than half the size of voliomem_maxpool_sz (in this example, 1MB):


vxsnap -g mydg -f unprepare vol1 vxsnap -g mydg prepare vol1 regionsize=1M

The prepare and addmir operations require an additional license when applied to a RAID-5 volume.

The instant snapshot and space-optimized snapshot operations are intended eventually to replace the traditionally third-mirror snapshot operations that are provided by the vxassist and vxplex commands.

Volume sets can be used in place of volumes with the following vxsnap operations on instant volume snapshots: addmir, dis, make, prepare, reattach, refresh, restore, rmmir, split, syncpause, syncresume, syncstart, syncstop, syncwait and unprepare.

A full-sized snapshot of a volume set must itself be a volume set. See the vxvset(1M) manual page for more information about administering volume sets.

The value of the volpagemod_max_memsz tunable affects the performance of the instant snapshots feature. See the vxtune(1M) manual page and the Veritas Volume Manager Administrator’s Guide for details.

SEE ALSO

vxassist(1M), vxcache(1M), vxcached(M), vxdg(1M), vxplex(1M), vxtask(1M), vxtune(1M), vxvset(1M)

Veritas Volume Manager Administrator’s Guide


VxVM 5.1 vxsnap (1M)