![]() |
< Previous | Next > |
Product: Volume Manager Guides | |
Manual: Volume Manager 4.1 Administrator's Guide |
Creating Traditional Third-Mirror Break-Off SnapshotsVxVM provides third-mirror break-off snapshot images of volume devices using vxassist and other commands. ![]() To enhance the efficiency and usability of volume snapshots, turn on FastResync as described in Enabling FastResync on a Volume. If Persistent FastResync is required, you must associate a version 0 DCO with the volume as described in Adding a Version 0 DCO and DCO Volume. You need a full license and a a VERITAS FlashSnapTM license to use this feature. The procedure described in this section requires a plex that is large enough to store the complete contents of the volume. For details of a method that uses space-optimized snapshots, see Creating Instant Snapshots. The recommended approach to performing volume backup from the command line, or from a script, is to use the vxassist command. The vxassist snapstart, snapwait, and snapshot tasks allow you to back up volumes online with minimal disruption to users. The vxassist snapshot procedure consists of two steps:
The vxassist snapstart step creates a write-only backup plex which gets attached to and synchronized with the volume. When synchronized with the volume, the backup plex is ready to be used as a snapshot mirror. The end of the update procedure is indicated by the new snapshot mirror changing its state to SNAPDONE. This change can be tracked by the vxassist snapwait task, which waits until at least one of the mirrors changes its state to SNAPDONE. If the attach process fails, the snapshot mirror is removed and its space is released. ![]() Once the snapshot mirror is synchronized, it continues being updated until it is detached. You can then select a convenient time at which to create a snapshot volume as an image of the existing volume. You can also ask users to refrain from using the system during the brief time required to perform the snapshot (typically less than a minute). The amount of time involved in creating the snapshot mirror is long in contrast to the brief amount of time that it takes to create the snapshot volume. The online backup procedure is completed by running the vxassist snapshot command on a volume with a SNAPDONE mirror. This task detaches the finished snapshot (which becomes a normal mirror), creates a new normal volume and attaches the snapshot mirror to the snapshot volume. The snapshot then becomes a normal, functioning volume and the state of the snapshot is set to ACTIVE. To back up a volume with the vxassist command, use the following procedure:
When the backup is complete, you have the following choices for what to do with the snapshot volume:
# vxedit [-g diskgroup] -rf rm snapshot ![]() Converting a Plex into a Snapshot Plex![]() It is recommended that the instant snapshot feature is used in preference to the procedure described in this section. In some circumstances, you may find it more convenient to convert an existing plex in a volume into a snapshot plex rather than running vxassist snapstart. For example, you may want to do this if you are short of disk space for creating the snapshot plex and the volume that you want to snapshot contains more than two plexes. The procedure can also be used to speed up the creation of a snapshot volume when a mirrored volume is created with more than two plexes and init=active is specified. ![]() To convert an existing plex into a snapshot plex for a volume on which Persistent FastResync is enabled, use the following command: # vxplex [-g diskgroup] -o dcoplex=dcologplex convert \ state=SNAPDONE plex dcologplex is the name of an existing DCO plex that is to be associated with the new snapshot plex. You can use the vxprint command to find out the name of the DCO volume as described in Adding a Version 0 DCO and DCO Volume. For example, to make a snapshot plex from the plex trivol-03 in the 3-plex volume trivol, you would use the following command: # vxplex -o dcoplex=trivol_dcl-03 convert state=SNAPDONE trivol-03 Here the DCO plex trivol_dco_03 is specified as the DCO plex for the new snapshot plex. To convert an existing plex into a snapshot plex in the SNAPDONE state for a volume on which Non-Persistent FastResync is enabled, use the following command: # vxplex [-g diskgroup] convert state=SNAPDONE plex A converted plex is in the SNAPDONE state, and can be used immediately to create a snapshot volume. ![]() Creating Multiple SnapshotsTo make it easier to create snapshots of several volumes at the same time, the snapshot option accepts more than one volume name as its argument, for example: # vxassist [-g diskgroup] snapshot volume1 volume2 ... By default, the first snapshot volume is named SNAP-volume, and each subsequent snapshot is named SNAPnumber-volume, where number is a unique serial number, and volume is the name of the volume for which the snapshot is being taken. This default pattern can be overridden by using the option -o name=pattern, as described on the vxassist(1M) manual page. For example, the pattern SNAP%v-%d reverses the order of the number and volume components in the name. To snapshot all the volumes in a single disk group, specify the option -o allvols to vxassist: # vxassist -g diskgroup -o allvols snapshot This operation requires that all snapstart operations are complete on the volumes. It fails if any of the volumes in the disk group do not have a complete snapshot plex in the SNAPDONE state. Reattaching a Snapshot Volume (vxassist snapback)![]() Snapback merges a snapshot copy of a volume with the original volume. One or more snapshot plexes are detached from the snapshot volume and re-attached to the original volume. The snapshot volume is removed if all its snapshot plexes are snapped back. This task resynchronizes the data in the volume so that the plexes are consistent. ![]() To merge one snapshot plex with the original volume, use the following command: # vxassist [-g diskgroup] snapback snapshot where snapshot is the snapshot copy of the volume. To merge all snapshot plexes in the snapshot volume with the original volume, use the following command: # vxassist [-g diskgroup] -o allplexes snapback snapshot To merge a specified number of plexes from the snapshot volume with the original volume, use the following command: # vxassist [-g diskgroup] snapback nmirror=number snapshot Here the nmirror attribute specifies the number of mirrors in the snapshot volume that are to be re-attached. Once the snapshot plexes have been reattached and their data resynchronized, they are ready to be used in another snapshot operation. By default, the data in the original volume is used to update the snapshot plexes that have been re-attached. To copy the data from the replica volume instead, use the following command: # vxassist [-g diskgroup] -o resyncfromreplica snapback snapshot ![]() Adding Plexes to a Snapshot VolumeIf you want to retain the existing plexes in a snapshot volume after a snapback operation, create additional snapshot plexes that are to be used for the snapback:
The new data plex is now ready to be used to perform a snapback operation. Dissociating a Snapshot Volume (vxassist snapclear)The link between a snapshot and its original volume can be permanently broken so that the snapshot volume becomes an independent volume. Use the following command to dissociate the snapshot volume, snapshot: # vxassist snapclear snapshot Displaying Snapshot Information (vxassist snapprint)The vxassist snapprint command displays the associations between the original volumes and their respective replicas (snapshot copies): # vxassist snapprint [volume] Output from this command is shown in the following examples: # vxassist -g mydg snapprint v1 V NAME USETYPE LENGTH SS SNAPOBJ NAME LENGTH %DIRTY DP NAME VOLUME LENGTH %DIRTY v v1 fsgen 20480 ss SNAP-v1_snp SNAP-v1 20480 4 dp v1-01 v1 20480 0 dp v1-02 v1 20480 0 v SNAP-v1 fsgen 20480 ss v1_snp v1 20480 0 # vxassist -g mydg snapprint v2 V NAME USETYPE LENGTH SS SNAPOBJ NAME LENGTH %DIRTY DP NAME VOLUME LENGTH %DIRTY v v2 fsgen 20480 ss -- SNAP-v2 20480 0 dp v2-01 v2 20480 0 v SNAP-v2 fsgen 20480 ss -- v2 20480 0 In this example, Persistent FastResync is enabled on volume v1, and Non-Persistent FastResync on volume v2. Lines beginning with v, dp and ss indicate a volume, detached plex and snapshot plex respectively. The %DIRTY field indicates the percentage of a snapshot plex or detached plex that is dirty with respect to the original volume. Notice that no snap objects are associated with volume v2 or with its snapshot volume SNAP-v2. See How Persistent FastResync Works with Snapshots for more information about snap objects. If a volume is specified, the snapprint command displays an error message if no FastResync maps are enabled for that volume. |
^ Return to Top | < Previous | Next > |
Product: Volume Manager Guides | |
Manual: Volume Manager 4.1 Administrator's Guide | |
VERITAS Software Corporation
www.veritas.com |