Previous  |  Next  >  
Product: Storage Foundation Guides   
Manual: Storage Foundation 4.1 Intelligent Storage Provisioning Administrator's Guide   

Creating Multiple Instant Snapshots


Note   Note    In these examples, all snapshot volumes and any cache volumes must be prepared in advance as described in Creating a Volume for Use as a Full-Sized Instant Snapshot and Creating a Shared Cache Volume and Preparing Space-Optimized Snapshots.

To make it easier to create snapshots of several volumes at the same time, the vxsnap make command accepts multiple tuples that define the source and snapshot volumes names as their arguments. For example, to create three instant snapshots, each with the same redundancy, the following form of the command can be used:


vxsnap [-g diskgroup] make \
  source=vol1/snapvol=snapvol1 \
  source=vol2/snapvol=snapvol2 \
  source=vol3/snapvol=snapvol3

The specified source volumes (vol1, vol2 and so on) may be the same volume or different volumes.

The vxsnap make command allows the snapshots to be of different types as shown here:


# vxsnap [-g diskgroup] make \
source=
vol1/snapvol=snapvol1 \
source=
vol2/snapvol=snapvol2

In this example, snapvol1 is a full-sized snapshot, and snapvol2 is a space-optimized snapshot.

Adding a Snapshot to a Cascaded Snapshot Hierarchy

To create a snapshot and push it onto a snapshot hierarchy between the original volume and an existing snapshot volume, specify the name of the existing snapshot volume as the value of the infrontof attribute to the vxsnap make command. The following example, shows how to place the space-optimized snapshot, thurs_bu, of the volume, dbvol, in front of the earlier snapshot, wed_bu:


# vxsnap -g dbdg make source=dbvol/snapvol=thurs_bu/\
infrontof=wed_bu/cache=dbdgcache

Similarly, the next snapshot that is taken, fri_bu, is placed in front of thurs_bu:


vxsnap -g dbdg make source=dbvol/snapvol=fri_bu/\
infrontof=thurs_bu/cache=dbdgcache

For more information on the application of cascaded snapshots, see the VERITAS Volume Manager Administrator's Guide.

Refreshing an Instant Snapshot (vxsnap refresh)

Refreshing an instant snapshot replaces it with another point-in-time copy of a parent volume. To refresh one or more snapshots and make them immediately available for use, use the following command:


vxsnap [-g diskgroup] refresh snapvol [source=vol] \
  [[snapvol2 source=vol2]...] [sync=yes|no]

If the source volume is not specified, the immediate parent of the snapshot is used. For full-sized instant snapshots, resynchronization is started by default. To disable resynchronization, specify the syncing=no attribute. This attribute is not supported for space-optimized snapshots.


Note   Note    The snapshot being refreshed must not be open to any application. For example, any file system configured on the volume must first be unmounted.

It is possible to refresh a volume from an unrelated volume provided that their sizes are compatible.

You can use the vxsnap syncwait command to wait for the synchronization of the snapshot volume to be completed, as shown here:


vxsnap [-g diskgroup] syncwait snapvol

See Controlling Instant Snapshot Synchronization for more information.

Attaching Plexes of an Instant Snapshot (vxsnap reattach)


Note   Note    Although this operation is named reattach, the plexes of an ISP snapshot volume could never have belonged to the parent volume. For this reason, the description below refers to the attachment, rather than the reattachment, of snapshot plexes.

This operation is not supported for space-optimized instant snapshots.

Using the following command, some or all plexes of an instant snapshot may be attached to the specified source volume, or to a source volume in the snapshot hierarchy above the snapshot volume:


# vxsnap -f [-g diskgroup] reattach snapvol source=vol \
[nmirror=
number]

Caution  Caution    This operation requires the specification of the -f (force) option as it violates the intent of the source volume. After the reattach operation completes, it may not be possible to perform other operations such as resizing the volume or transforming the layout of the volume. To restore the intent of the volume and allow such operations to be performed, use the vxplex dis plex command to dissociate the attached snapshot plexes.

By default, all the plexes are attached, which results in the removal of the snapshot. If required, the number of plexes to be attached may be specified as the value assigned to the nmirror attribute.


Note   Note    The snapshot being reattached must not be open to any application. For example, any file system configured on the snapshot volume must first be unmounted.

Only the plexes of a snapshot volume that was set up using ISP may be attached.

If the snapshot volume and the source volume lie in different storage pools, the underlying disks of the snapshot volume are moved to the source volume's storage pool. However, if other objects in the snapshot volume's storage pool are also configured on these disks, the reattach command fails.

For example the following command attaches one plex from the snapshot volume, snapmyvol, to the volume, myvol:


vxsnap -g mydg -f reattach snapmyvol source=myvol nmirror=1

Restoring a Volume from an Instant Snapshot (vxsnap restore)

On occasion, it may be desirable to reinstate the contents of a volume from a backup or modified replica within a snapshot volume. The following command may be used to restore a volume:


vxsnap [-g diskgroup] restore [nmirrors=numbervol \
  [source=snapvol] [destroy=yes|no]

For a full instant snapshot, some or all of its plexes may be reattached to the parent volume or to a specified source volume in the snapshot hierarchy above the snapshot volume. If destroy=yes is specified, all the plexes of the snapshot are reattached and the snapshot volume is removed.

For a space-optimized instant snapshot, the cached data is used to restore the contents of the specified volume. The snapshot itself remains unchanged by the operation.


Note   Note    For this operation to succeed, the volume that is being restored and the snapshot volume must not be open to any application. For example, any file systems that are configured on either volume must first be unmounted.

It is not possible to restore a volume from an unrelated volume.

The destroy and nmirror attributes are not supported for space-optimized instant snapshots.

The following example demonstrates how to restore the volume, myvol, from the space-optimized snapshot, snap3myvol.


vxsnap -g mydg restore myvol source=snap3myvol

Dissociating an Instant Snapshot (vxsnap dis)

The following command breaks the association between a snapshot volume, snapvol, and its parent volume, so that the snapshot may be used as an independent volume:


vxsnap [-f] [-g diskgroup] dis snapvol

This operation fails if the snapshot, snapvol, has a snapshot hierarchy below it that contains unsynchronized snapshots. If this happens, the dependent snapshots must be fully synchronized from snapvol. When no dependent snapshots remain, snapvol may be dissociated. The snapshot hierarchy is then adopted by snapvol's parent volume.


Note   Note    To be usable after dissociation, the snapshot volume and any snapshots in the hierarchy must have been fully synchronized. See Controlling Instant Snapshot Synchronization for more information. In addition, you cannot dissociate a snapshot if synchronization of any of the dependent snapshots in the hierarchy is incomplete. If an incomplete snapshot is dissociated, it is unusable and should be deleted as described in Removing an Instant Snapshot.

The following command dissociates the snapshot, snap2myvol, from its parent volume:


vxsnap -g mydg dis snap2myvol
Note   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.

Removing an Instant Snapshot

When you have dissociated a full-sized instant snapshot, you can use the vxvoladm command to delete it altogether, as shown in this example:


vxvoladm -g mydg remove volume snap2myvol

You can also use this command to remove a space-optimized instant snapshot from its cache. For details of how to remove a cache, see Removing a Cache.

Splitting an Instant Snapshot Hierarchy (vxsnap split)


Note   Note    This operation is not supported for space-optimized instant snapshots.

The following command breaks the association between a snapshot hierarchy that has the snapshot volume, snapvol, at its head, and its parent volume, so that the snapshot hierarchy may be used independently of the parent volume:


vxsnap [-f] [-g diskgroup] split snapvol
Note   Note    The topmost snapshot volume in the hierarchy must have been fully synchronized for this command to succeed. Snapshots that are lower down in the hierarchy need not have been fully resynchronized. See Controlling Instant Snapshot Synchronization for more information.

The following command splits the snapshot hierarchy under snap2myvol from its parent volume:


vxsnap -g mydg split snap2myvol
Note   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.

Displaying Instant Snapshot Information (vxsnap print)

The vxsnap print command may be used to display information about the snapshots that are associated with a volume.


vxsnap [-g diskgroup] print [vol]

This command shows the percentage progress of the synchronization of a snapshot or volume. If no volume is specified, information about the snapshots for all the volumes in a disk group is displayed.

The following example shows a volume, vol1, which has a full-sized snapshot, snapvol1 whose contents have not been synchronized with vol1:


vxsnap -g mydg print
NAME      SNAPOBJECT         TYPE     PARENT        SNAPSHOT       %DIRTY      %VALID

vol1      --         volume     --       --       --      100
      snapvol1_snp1         volume     --       snapvol1       1.30      --
snapvol1      vol1_snp1         volume     vol1       --       1.30      1.30

The %DIRTY value for snapvol1 shows that its contents have changed by 1.30% when compared with the contents of vol1. As snapvol1 has not been synchronized with vol1, the %VALID value is the same as the %DIRTY value. If the snapshot were partly synchronized, the %VALID value would lie between the %DIRTY value and 100%. If the snapshot were fully synchronized, the %VALID value would be 100%. The snapshot could then be made independent or moved into another disk group.

Controlling Instant Snapshot Synchronization


Note   Note    Synchronization of the contents of a snapshot with its original volume is not possible for space-optimized instant snapshots.

By default, synchronization is enabled for the vxsnap refresh and restore operation on instant snapshots. Otherwise, synchronization is disabled unless you specify the sync=yes attribute to the vxsnap command.

The following table shows the commands that are provided for controlling the synchronization manually.

Command Description

vxsnap [-g diskgroup] syncpause vol

Pause synchronization of a volume.

vxsnap [-g diskgroup] syncresume vol

Resume synchronization of a volume.

vxsnap [-b] [-g diskgroup] syncstart vol

Start synchronization of a volume. The -b option puts the operation in the background.

vxsnap [-g diskgroup] syncstop vol

Stop synchronization of a volume.

vxsnap [-g diskgroup] syncwait vol

Exit when synchronization of a volume is complete. An error is returned if vol is invalid (for example, it is a space-optimized snapshot), or if vol is not being synchronized.

Improving the Performance of Snapshot Synchronization

Two optional arguments to the -o option are provided to help optimize the performance of synchronization when using the make, refresh, restore and syncstart operations:

iosize=size Specifies the size of each I/O request that is used when synchronizing the regions of a volume. Specifying a larger size causes synchronization to complete sooner, but with greater impact on the performance of other processes that are accessing the volume. The default size of 1m (1MB) is suggested as the minimum value for high-performance array and controller hardware. The specified value is rounded to a multiple of the volume's region size.

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. The default value of iodelay is 0 milliseconds (no delay). Increasing this value slows down synchronization, and reduces the competition for I/O bandwidth with other processes that may be accessing the volume.

Options may be combined as shown in the following examples:


# vxsnap -g mydg -o iosize=2m,slow=100 make \
source=myvol/snapvol=snap2myvol/syncing=on

# vxsnap -g mydg -o iosize=10m,slow=250 syncstart snap2myvol
Note   Note    These optional parameters only affect the synchronization of full-sized instant snapshots. They are not supported for space-optimized snapshots.
 ^ Return to Top Previous  |  Next  >  
Product: Storage Foundation Guides  
Manual: Storage Foundation 4.1 Intelligent Storage Provisioning Administrator's Guide  
VERITAS Software Corporation
www.veritas.com