LDP/LDP/guide/docbook/EVMSUG/appx-snap.xml

138 lines
7.5 KiB
XML

<appendix id="appxsnapplug"><title>The snapshot plug-in</title>
<para>A snapshot represents a frozen image of a volume. The source of a snapshot is
called an &quot;original.&quot; When a snapshot is created, it looks exactly like the original
at that point in time. As changes are made to the original, the snapshot remains the
same and looks exactly like the original at the time the snapshot was created.</para>
<para>The snapshot feature is very useful for performing data backups. In order to perform a consistent backup, the volume that is being backed up should not change while the
backup is running. This often means the volume must be taken offline during the
backup, which can be a significant inconvenience to users. With snapshots, the
volume can be kept online. A snapshot of the volume is created and the backup is taken
from the snapshot, while the original remains in active use.</para>
<sect1 id="snapimp"><title>How snapshotting is implemented</title>
<para>A snapshot represents a copy of its original volume &quot;frozen&quot; at some
point in time. Instead of actually copying all the data from the original to the snapshot,
a portion of data is copied only when that portion is being modified on the original.
This data portion is called a &quot;chunk.&quot;</para>
<para>When data is written to a chunk on the original volume, the snapshot intercepts
the I/O request and determines if that chunk has already been saved.
If the chunk has not been saved, the chunk is copied from the original to the
snapshot, and then the write request is allowed to proceed to the original volume.
If additional data is written to that same chunk on the original, the chunk does not
need to be copied again.</para>
<para>When data is read from the snapshot, it is the same as when data is read from the original.
When a chunk of data is read from the snapshot, the snapshot determines if that
chunk has been saved. If it has, the data is retrieved from the snapshot.
If the chunk has not been saved, the data is retrieved from the original.</para>
</sect1>
<sect1 id="snapcreateact"><title>Creating and activating snapshot objects</title>
<para>Creating and activating a snapshot is a two-step process. The first step is to
create the snapshot object. The snapshot object specifies where the saved data will
be stored when changes are made to the original. The second step is to activate the
object, which is to make an EVMS volume from the object.</para>
<sect2><title>Creating a snapshot</title>
<para>You can create a snapshot object from any unused storage object in EVMS
(disks, segments, regions, or feature objects). The size of this consumed object is
the size available to the snapshot object. The snapshot object can be smaller
or larger than the original volume. If the object is smaller, the original volume could fill up
as data is copied from the original to the snapshot, given sufficient activity on the original.
In this situation, the snapshot is deactivated and additional I/O to the snapshot fails.
</para>
<para>Base the size of the snapshot object on the amount of activity that is likely to take place
on the original during the lifetime of the snapshot. The more changes that occur on the
original and the longer the snapshot is expected to remain active, the larger the snapshot
should be. Clearly, determining this calculation is not simple and requires trial and error to determine the correct snapshot object size to use for a particular situation. The goal is
to create a snapshot object large enough to prevent the snapshot from being
deactivated if it fills up, yet small enough to not waste disk space. If the snapshot
object is the same size as the original volume (actually, a little larger, to account for
the snapshot mapping tables), the snapshot is never deactivated.</para>
<para><xref linkend="evmscreatesnap"></xref> tells how to create snapshots. The following options are available for
creating snapshot objects through the CLI:</para>
<variablelist>
<varlistentry><term>original</term>
<listitem><para>The name of the volume to take a snapshot of.
Only volumes (EVMS or compatibility) can be snapshotted.
Other storage objects cannot be snapshotted.
</para>
</listitem>
</varlistentry>
<varlistentry><term>snapshot</term>
<listitem><para>The name to assign to the new snapshot object.
</para>
</listitem>
</varlistentry>
<varlistentry><term>chunksize</term>
<listitem><para>The granularity of the data that is copied from the
original to the snapshot. The default chunksize is 64 KB.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2><title>Activating a snapshot</title>
<para>After you create a snapshot, activate it by making an EVMS volume from the object.
After you create the volume and save the changes, the snapshot is active. The only
option for activating snapshots is the name to give the EVMS volume. This name can be
the same as or different than the name of the snapshot object.</para>
</sect2>
</sect1>
<sect1><title>Other snapshot activities</title>
<para>In addition to creating and activating snapshots, you can also reinitialize them,
delete them, and roll them back. The following sections describe these tasks.</para>
<sect2><title>Reinitializing a snapshot</title>
<para>Snapshots can be reinitialized, which causes all of the saved data to be erased and
starts the snapshot from the current point in time. A reinitialized snapshot has the same
original, chunk size, and writeable flags as the original snapshot.</para>
<para>To reinitialize a snapshot, delete the EVMS volume from the snapshot without
deleting the snapshot object. Then create a new EVMS volume from the snapshot object.
</para>
</sect2>
<sect2><title>Deleting a snapshot</title>
<para>When a snapshot is no longer needed, you can remove it by deleting the EVMS
volume from the snapshot object, and then deleting the snapshot object. Because the
snapshot saved the initial state of the original volume (and not the changed state),
the original is always up-to-date and does not need any modifications when a snapshot
is deleted.</para>
<para>No options are available for deleting snapshots.</para>
</sect2>
<sect2><title>Rolling back a snapshot</title>
<para>Situations can arise where a user wants to restore the original volume to
the saved state of the snapshot. This action is called a rollback. One such scenario
is if the data on the original is lost or corrupted. Snapshot rollback acts as a quick
backup and restore mechanism, and allows the user to avoid a more lengthy restore
operation from tapes or other archives.</para>
<para>Another situation where rollback can be particularly useful is when you are
testing new software. Before you install a new software package, create a writeable
snapshot of the target volume. You can then install the software to the snapshot
volume, instead of to the original, and then test and verify the new software on the
snapshot. If the testing is successful, you can then roll back the snapshot to the
original and effectively install the software on the regular system. If there is a problem
during the testing, you can simply delete the snapshot without harming the original
volume.</para>
<para>Rollback can only be performed when both the snapshot and the original volumes
are unmounted and otherwise not in use. Rollback can also be performed only when
there is only a single snapshot of an original. If an original has multiple snapshots,
all but the desired snapshot must be deleted before rollback can take place.</para>
<para>No options are available for rolling back snapshots.</para>
</sect2>
</sect1>
</appendix>