Adding an instant snap DCO and DCO volume

To prepare a volume for instant snapshots, an instant snap data change object (DCO) and DCO volume must be associated with that volume. This procedure also enables Persistent FastResync on the volume.

The following procedure is required only if the volume does not have an instant snap DCO volume.

By default, volumes on thin provisioning LUNs are created with an instant snap DCO volume.

To add an instant snap DCO and DCO volume

  1. Verify that the volume has an instant snap data change object (DCO) and DCO volume, and that FastResync is enabled on the volume:
    # vxprint -g volumedg -F%instant volume
    # vxprint -g volumedg -F%fastresync volume

    If both commands return a value of on, skip to step 3. Otherwise continue with step 2.

  2. To prepare a volume for instant snapshots, use the following command:
    # vxsnap [-g diskgroup] prepare volume [regionsize=size] \ 
      [ndcomirs=number] [alloc=storage_attributes]

    Run the vxsnap prepare command on a volume only if it does not have an instant snap 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 \
      alloc=mydg10,mydg11

    This example creates a DCO object and redundant DCO volume with two plexes located on disks mydg10 and mydg11, 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.

  3. If you need several space-optimized instant snapshots for the volumes in a disk group, you may find it convenient to create a single shared cache object in the disk group rather than a separate cache object for each snapshot.

    For full-sized instant snapshots and linked break-off snapshots, you must prepare a volume that is to be used as the snapshot volume. This volume must be the same size as the data volume for which the snapshot is being created, and it must also have the same region size.

Creating a shared cache object

If you need several space-optimized instant snapshots for the volumes in a disk group, you can create a single shared cache object in the disk group rather than a separate cache object for each snapshot.

To create a shared cache object

  1. Decide on the following characteristics that you want to allocate to the cache volume that underlies the cache object:

    • The cache volume size should be sufficient to record changes to the parent volumes during the interval between snapshot refreshes. A suggested value is 10% of the total size of the parent volumes for a refresh interval of 24 hours.

    • The cache volume can be mirrored for redundancy.

    • If the cache volume is mirrored, space is required on at least as many disks as it has mirrors. These disks should not be shared with the disks used for the parent volumes. The disks should not be shared with disks used by critical volumes to avoid impacting I/O performance for critical volumes, or hindering disk group split and join operations.

  2. Having decided on its characteristics, use the vxassist command to create the cache volume. The following example creates a mirrored cache volume, cachevol, with size 1GB in the disk group, mydg, on the disks mydg16 and mydg17:
    # vxassist -g mydg make cachevol 1g layout=mirror \
      init=active mydg16 mydg17

    The attribute init=active makes the cache volume immediately available for use.

  3. Use the vxmake cache command to create a cache object on top of the cache volume that you created in the previous step:
    # vxmake [-g diskgroup] cache cache_object \
      cachevolname=volume [regionsize=size] [autogrow=on] \
      [highwatermark=hwmk] [autogrowby=agbvalue] \
      [maxautogrow=maxagbvalue]]

    If the region size, regionsize, is specified, it must be a power of 2, and be greater than or equal to 16KB (16k). If not specified, the region size of the cache is set to 64KB.

    All space-optimized snapshots that share the cache must have a region size that is equal to or an integer multiple of the region size set on the cache. Snapshot creation also fails if the original volume's region size is smaller than the cache's region size.

    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.

    To prevent the cache from growing automatically, specify autogrow=off. By default, autogrow=on.

    In the following example, the cache object, cobjmydg, is created over the cache volume, cachevol, the region size of the cache is set to 32KB, and the autogrow feature is enabled:

    # vxmake -g mydg cache cobjmydg cachevolname=cachevol \
      regionsize=32k autogrow=on
  4. Enable the cache object using the following command:
    # vxcache [-g diskgroup] start cache_object

    For example to start the cache object, cobjmydg:

    # vxcache -g mydg start cobjmydg

Creating a volume for use as a full-sized instant or linked break-off snapshot

To create an empty volume for use by a full-sized instant snapshot or a linked break-off snapshot

  1. Use the vxprint command on the original volume to find the required size for the snapshot volume.
    # LEN='vxprint [-g diskgroup] -F%len volume'

    The command as shown assumes a Bourne-type shell such as sh, ksh or bash. You may need to modify the command for other shells such as csh or tcsh.

  2. Use the vxprint command on the original volume to discover the name of its DCO:
    # DCONAME='vxprint [-g diskgroup] -F%dco_name volume'
  3. Use the vxprint command on the DCO to discover its region size (in blocks):
    # RSZ='vxprint [-g diskgroup] -F%regionsz $DCONAME'
  4. Use the vxassist command to create a volume, snapvol, of the required size and redundancy, together with an instant snap DCO volume with the correct region size:
    # vxassist [-g diskgroup] make snapvol $LEN \
      [layout=mirror nmirror=number] logtype=dco drl=off \
      dcoversion=20 [ndcomirror=number] regionsz=$RSZ \
      init=active [storage_attributes]

    Storage attributes give you control over the devices, including disks and controllers, which vxassist uses to configure a volume.

    Specify the same number of DCO mirrors (ndcomirror) as the number of mirrors in the volume (nmirror). The init=active attribute makes the volume available immediately. You can use storage attributes to specify which disks should be used for the volume.

    As an alternative to creating the snapshot volume and its DCO volume in a single step, you can first create the volume, and then prepare it for instant snapshot operations as shown here:

    # vxassist [-g diskgroup] make snapvol $LEN \
      [layout=mirror nmirror=number] init=active \
      [storage_attributes]
    # vxsnap [-g diskgroup] prepare snapvol [ndcomirs=number] \
      regionsize=$RSZ [storage_attributes]
Upgrading the instant snap Data Change Objects (DCOs) and DCO volumes for a VxVM volume

Instant snap DCOs, formerly known as version 20 DCOs, support the creation of instant snapshots for VxVM volumes. Upgrade the instant snap DCOS and DCO volumes to ensure compatability with the latest version of VxVM. The upgrade operation can be performed while the volumes are online.

The upgrade operation does not support upgrade from version 0 DCOs.

To upgrade the instant snap DCOs for all volumes in the disk group

  1. Make sure that the disk group is at least version 180. To upgrade the disk group:
    # vxdg upgrade diskgroup
  2. Use the following command to upgrade the instant snap DCOs for all volumes in the disk group:
    # vxsnap -g diskgroup upgradeall

    Where:diskgroup is the disk group that contains the volumes to be upgraded.

    For additional options to the upgradeall operation, see the vxsnap(1M) manual page.

To upgrade the instant snap DCOs for specified volumes

  1. Make sure that the disk group is at least version 180. To upgrade the disk group:
    # vxdg upgrade diskgroup
  2. To upgrade the DCOs, specify one or more volumes or volume sets to the following command:
    # vxsnap [-g diskgroup] upgrade 
    [volume1|volset1][volume2|volset2...]

    Where:diskgroup is the disk group that contains the volumes to be upgraded.

    For additional options to the upgrade operation, see the vxsnap(1M) manual page.

More Information

Creating a shared cache object

Creating a volume for use as a full-sized instant or linked break-off snapshot