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

Creating Instant Snapshots


Note   Note    Instant snapshots of ISP application volumes in a disk group's data pool are best created in clone pools that are also associated with the same disk group. A snapshot of a snapshot does not have to be in the same clone pool as its parent.

Volume sets can be used in place of volumes with the following vxsnap operations on instant snapshots: addmir, dis, make, prepare, reattach, refresh, restore, rmmir, split, syncpause, syncresume, syncstart, syncstop, syncwait, and unprepare. A snapshot of a volume set must itself be a volume set. A full-sized instant snapshot of a volume set can be created using a prepared volume set. You cannot use the nmirrors or plex attributes to specify that existing plexes are to be broken off. See the chapter "Creating and Administering Volume Sets" in the VERITAS Volume Manager Administrator's Guide for more information on creating volume sets.


Note   Note    You may need an additional license to use this feature.

VxVM allows you to make instant snapshots of volumes by using the vxsnap command.

A plex in a full-sized instant snapshot requires as much space as the original volume. If you instead make a space-optimized instant snapshot of a volume, this only requires enough storage to record the original contents of the parent volume as they are changed during the life of the snapshot.

The recommended approach to performing volume backup from the command line, or from a script, is to use the vxsnap command. The vxsnap prepare and make tasks allow you to back up volumes online with minimal disruption to users.

The vxsnap prepare step creates a DCO and DCO volume and associates this with the volume. It also enables Persistent FastResync on the volume.

The vxsnap make step creates an instant snapshot that is immediately available for making a backup. After the snapshot has been taken, read requests for data in the original volume are satisfied by reading either from a non-updated region of the original volume, or from the copy of the original contents of an updated region that have been recorded by the snapshot.


Note   Note    Synchronization of a full-sized instant snapshot from the original volume is enabled by default. If you specify the syncing=no attribute to vxsnap make, this disables synchronization, and the contents of the instant snapshot are unlikely ever to become fully synchronized with the contents of the original volume at the point in time that the snapshot was taken. If you wish to move an instant snapshot volume to another disk group for export to another machine for off-host processing, or to turn it into an independent volume, you must ensure that the snapshot volume has been completely synchronized.

You can immediately retake a full-sized or space-optimized instant snapshot at any time by using the vxsnap refresh command. If a fully synchronized instant snapshot is required, you must wait for the new resynchronization to complete.

To back up a volume with the vxsnap command, use the following procedure:

  1. If you intend to take a space-optimized instant snapshot of the volume, you must first set up a shared cache volume in the same disk group as the volume. This cache object for this cache volume can be maintained by using the vxcache command.

    For both full-sized and space-optimized instant snapshots, you must also create a volume for use as the snapshot volume. This volume must have the same region size as that of the volume for which the snapshot is being created. In addition, a volume that is created for use as a full-sized instant snapshot must be the same size as the volume for which the snapshot is being created.

    See Creating a Shared Cache Volume and Preparing Space-Optimized Snapshots for details of how to set up a shared cache volume, and how to prepare space-optimized snapshots that share this cache.

    See Creating a Volume for Use as a Full-Sized Instant Snapshot for details of how to prepare a volume for use as a full-sized instant snapshot.


    Note   Note    If you intend to split the clone pool that contains snapshots into separate disk groups (for example, to perform off-host processing), the clone pool must only contain fully synchronized full-sized instant snapshots (which do not require a cache volume). You cannot split off a clone pool that contains either a cache volume or space-optimized instant snapshots.
  2. Use the following commands on the primary host to see if the volume is associated with a version 20 data change object (DCO) and DCO volume that allow instant snapshots and Persistent FastResync to be used with the volume, and to check that FastResync is enabled on the volume:
    vxprint -g volumedg -F%instant volume
    vxprint -g volumedg -F%fastresync volume

    If both these command return a value of on, the volume can be used for instant snapshot operations.

    To prepare a volume for instant snapshots, use the following command:


    vxsnap [-g diskgroup] prepare volume [regionsize=size] \ 
      [ndcomirs=number] [alloc=storage_attributes]
    Note   Note    It is only necessary to run this command on a volume if it does not already have a version 20 DCO volume.

    For example, to prepare the volume, myvol, in the disk group, mydg, use the following command:


    vxsnap -g mydg prepare myvol regionsize=128k ndcomirs=2

    This example creates a DCO object and redundant DCO volume with two plexes, and associates them with myvol. The region size is also increased to 128KB from the default size of 64KB. The region size must be a power of 2, and be greater than or equal to 16KB. A smaller value requires more disk space for the change maps, but the finer granularity provides faster resynchronization.


    Note   Note    If you intend to create space-optimized instant snapshots that share a cache volume, the region size that you specify for the volume must be greater than or equal to any region size that you specify for the cache volume. Creation of space-optimized snapshots that use a shared cache fails if the region size of the volume is smaller than the region size of the cache.

    If the region size of a space-optimized snapshot differs from the region size of the cache, this can degrade the system's performance compared to the case where the region sizes are the same.

  3. Use the vxsnap make step to create an instant snapshot that is immediately available for making a backup. If you specify a name or size for a storage cache, a space-optimized snapshot is created that requires less space than does a full-sized instant snapshot volume.

  • To create a full-sized instant snapshot, snapvol, use one of the following forms of the vxsnap make command:

  • vxsnap [-g diskgroup] make source=volume/snapvol=snapvol\
      [/syncing=off]
    Note   Note    The attributes for a snapshot are specified as a tuple. The vxsnap make command accepts multiple tuples; one for each snapshot that is being created. A tuple for a full-sized instant snapshot must contain a source attribute and a snapvol attribute. Each element of a tuple is separated from the next by a slash character (/). Tuples are separated by white space.
    This command specifies an existing volume, snapvol, that is to be used as the snapshot volume. See Creating a Volume for Use as a Full-Sized Instant Snapshot for details.
    Background synchronization of the snapshot volume from its parent volume is enabled by default (equivalent to specifying the syncing=on attribute). If you do not want to move the snapshot into a separate disk group, or turn it into an independent volume, specify the syncing=off attribute to disable synchronization. This avoids unnecessary system overhead.
    For example, to use the prepared volume, snap1myvol, as the snapshot for the volume, myvol, in the disk group, mydg, use the following command:

    vxsnap -g mydg make source=myvol/snapvol=snap1myvol
    If you want to move a snapshot into a separate disk group, or to turn it into an independent volume, you must wait for its contents to be synchronized with those of its parent volume.
    For example, to use the prepared volume, snap2myvol, as the snapshot for the volume, myvol, in the disk group, mydg, on the volume, use the following command:

    vxsnap -g mydg make source=myvol/snapvol=snap2myvol
    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 
    For example, you would use the following command to wait for synchronization to finish on the snapshot volume, snap2myvol:

    vxsnap -g mydg syncwait snap2myvol
    This command exits (with a return code of zero) when synchronization of the snapshot volume is complete. The snapshot volume may then be moved to another disk group or turned into an independent volume.
    If required, you can use the following command to verify whether the V_PFLAG_INCOMPLETE flag is set on a volume:

    vxprint [-g diskgroup] -F%incomplete snapvol
    This command returns the value off if synchronization of the volume, snapvol, is complete; otherwise, it returns the value on.
    See Controlling Instant Snapshot Synchronization for more information.
  • To create a space-optimized instant snapshot, snapvol, that uses a prepared space-optimized snapshot:

  • vxsnap [-g diskgroup] make source=vol/snapvol=snapvol
    For example, to create the space-optimized instant snapshot of the volume, myvol, in the disk group, mydg, and the prepared snapshot, snap3myvol, enter the following command:

    vxsnap -g mydg make source=myvol/snapvol=snap3myvol
    For details of how to create a shared cache object and prepare a snapshot that uses this cache, see Creating a Shared Cache Volume and Preparing Space-Optimized Snapshots.

  1. Use fsck (or some utility appropriate for the application running on the volume) to clean the temporary volume's contents. For example, you can use this command:
    fsck -F vxfs /dev/vx/rdsk/diskgroup/snapshot
  2. If you require a backup of the data in the snapshot, use an appropriate utility or operating system command to copy the contents of the snapshot to tape, or to some other backup medium.

You have the following choices for what to do with an instant snapshot:

  • Refresh the contents of the snapshot. This creates a new point-in-time image of the original volume ready for another backup. If synchronization was already in progress on the snapshot, this operation may result in large portions of the snapshot having to be resynchronized. See Refreshing an Instant Snapshot (vxsnap refresh) for details.
  • Restore the contents of the original volume from the snapshot volume. For full instant snapshot volumes, you can choose whether none, a subset, or all of the plexes of the snapshot volume are returned to the original volume as a result of the operation. A space-optimized instant snapshot always remains intact at the end of the operation. See Restoring a Volume from an Instant Snapshot (vxsnap restore) for details.
  • Dissociate the snapshot volume entirely from the original volume. This may be useful if you want to use the copy for other purposes such as testing or report generation. If desired, you can delete the dissociated volume. See Dissociating an Instant Snapshot (vxsnap dis) for details.

  • Note   Note    For space-optimized instant snapshots, this operation is only useful if you then want to delete the snapshot altogether.
  • If the snapshot is part of a snapshot hierarchy, you can also choose to split this hierarchy from its parent volumes. See Splitting an Instant Snapshot Hierarchy (vxsnap split) for details.

  • Note   Note    This operation is not supported for space-optimized instant 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