mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
snapshots: Avoid term 'checkpoint' for full system snapshot
Upcoming patches plan to introduce virDomainCheckpointPtr as a new object for use in incremental backups, along with documentation on how incremental backups differ from snapshots. But first, we need to rename any existing mention of a 'system checkpoint' to instead be a 'full system snapshot', so that we aren't overloading the term checkpoint. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
5817dec014
commit
d152c727c6
@ -33,7 +33,7 @@
|
|||||||
resume in a consistent state; but if the disks are modified
|
resume in a consistent state; but if the disks are modified
|
||||||
externally in the meantime, this is likely to lead to data
|
externally in the meantime, this is likely to lead to data
|
||||||
corruption.</dd>
|
corruption.</dd>
|
||||||
<dt>system checkpoint</dt>
|
<dt>full system</dt>
|
||||||
<dd>A combination of disk snapshots for all disks as well as VM
|
<dd>A combination of disk snapshots for all disks as well as VM
|
||||||
memory state, which can be used to resume the guest from where it
|
memory state, which can be used to resume the guest from where it
|
||||||
left off with symptoms similar to hibernation (that is, TCP
|
left off with symptoms similar to hibernation (that is, TCP
|
||||||
@ -55,11 +55,12 @@
|
|||||||
as <code>virDomainSaveImageGetXMLDesc()</code> to work with
|
as <code>virDomainSaveImageGetXMLDesc()</code> to work with
|
||||||
those files.
|
those files.
|
||||||
</p>
|
</p>
|
||||||
<p>System checkpoints are created
|
<p>Full system snapshots are created
|
||||||
by <code>virDomainSnapshotCreateXML()</code> with no flags, and
|
by <code>virDomainSnapshotCreateXML()</code> with no flags, while
|
||||||
disk snapshots are created by the same function with
|
disk snapshots are created by the same function with
|
||||||
the <code>VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</code> flag; in
|
the <code>VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</code>
|
||||||
both cases, they are restored by
|
flag. Regardless of the flags provided, restoration of the
|
||||||
|
snapshot is handled by
|
||||||
the <code>virDomainRevertToSnapshot()</code> function. For
|
the <code>virDomainRevertToSnapshot()</code> function. For
|
||||||
these types of snapshots, libvirt tracks each snapshot as a
|
these types of snapshots, libvirt tracks each snapshot as a
|
||||||
separate <code>virDomainSnapshotPtr</code> object, and maintains
|
separate <code>virDomainSnapshotPtr</code> object, and maintains
|
||||||
@ -128,13 +129,10 @@
|
|||||||
what file name is created in an external snapshot. On output,
|
what file name is created in an external snapshot. On output,
|
||||||
this is fully populated to show the state of each disk in the
|
this is fully populated to show the state of each disk in the
|
||||||
snapshot, including any properties that were generated by the
|
snapshot, including any properties that were generated by the
|
||||||
hypervisor defaults. For system checkpoints, this field is
|
hypervisor defaults. For full system snapshots, this field is
|
||||||
ignored on input and omitted on output (a system checkpoint
|
ignored on input and omitted on output (a full system snapshot
|
||||||
implies that all disks participate in the snapshot process,
|
implies that all disks participate in the snapshot process).
|
||||||
and since the current implementation only does internal system
|
This element has a list of <code>disk</code>
|
||||||
checkpoints, there are no extra details to add); a future
|
|
||||||
release may allow the use of <code>disks</code> with a system
|
|
||||||
checkpoint. This element has a list of <code>disk</code>
|
|
||||||
sub-elements, describing anywhere from zero to all of the
|
sub-elements, describing anywhere from zero to all of the
|
||||||
disks associated with the domain. <span class="since">Since
|
disks associated with the domain. <span class="since">Since
|
||||||
0.9.5</span>
|
0.9.5</span>
|
||||||
@ -206,11 +204,12 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt><code>state</code></dt>
|
<dt><code>state</code></dt>
|
||||||
<dd>The state of the domain at the time this snapshot was taken.
|
<dd>The state of the domain at the time this snapshot was taken.
|
||||||
If the snapshot was created as a system checkpoint, then this
|
If a full system snapshot was created, then this
|
||||||
is the state of the domain at that time; when the domain is
|
is the state of the domain at that time. When the domain is
|
||||||
reverted to this snapshot, the domain's state will default to
|
reverted to this snapshot, the domain's state will default to
|
||||||
whatever is in this field unless additional flags are passed
|
this state, unless overridden
|
||||||
to <code>virDomainRevertToSnapshot()</code>. Additionally,
|
by <code>virDomainRevertToSnapshot()</code> flags to revert to
|
||||||
|
a running or paused state. Additionally,
|
||||||
this field can be the value "disk-snapshot"
|
this field can be the value "disk-snapshot"
|
||||||
(<span class="since">since 0.9.5</span>) when it represents
|
(<span class="since">since 0.9.5</span>) when it represents
|
||||||
only a disk snapshot (no VM memory state), and reverting to this
|
only a disk snapshot (no VM memory state), and reverting to this
|
||||||
|
@ -59,7 +59,7 @@ typedef enum {
|
|||||||
VIR_DOMAIN_SNAPSHOT_CREATE_HALT = (1 << 3), /* Stop running guest
|
VIR_DOMAIN_SNAPSHOT_CREATE_HALT = (1 << 3), /* Stop running guest
|
||||||
after snapshot */
|
after snapshot */
|
||||||
VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY = (1 << 4), /* disk snapshot, not
|
VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY = (1 << 4), /* disk snapshot, not
|
||||||
system checkpoint */
|
full system */
|
||||||
VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT = (1 << 5), /* reuse any existing
|
VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT = (1 << 5), /* reuse any existing
|
||||||
external files */
|
external files */
|
||||||
VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE = (1 << 6), /* use guest agent to
|
VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE = (1 << 6), /* use guest agent to
|
||||||
|
@ -1296,8 +1296,8 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
|
|||||||
if ((other->def->state == VIR_DOMAIN_DISK_SNAPSHOT) !=
|
if ((other->def->state == VIR_DOMAIN_DISK_SNAPSHOT) !=
|
||||||
(def->state == VIR_DOMAIN_DISK_SNAPSHOT)) {
|
(def->state == VIR_DOMAIN_DISK_SNAPSHOT)) {
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("cannot change between disk snapshot and "
|
_("cannot change between disk only and "
|
||||||
"system checkpoint in snapshot %s"),
|
"full system in snapshot %s"),
|
||||||
def->name);
|
def->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,9 @@ virDomainSnapshotGetConnect(virDomainSnapshotPtr snapshot)
|
|||||||
* contained in xmlDesc.
|
* contained in xmlDesc.
|
||||||
*
|
*
|
||||||
* If @flags is 0, the domain can be active, in which case the
|
* If @flags is 0, the domain can be active, in which case the
|
||||||
* snapshot will be a system checkpoint (both disk state and runtime
|
* snapshot will be a full system snapshot (capturing both disk state,
|
||||||
* VM state such as RAM contents), where reverting to the snapshot is
|
* and runtime VM state such as RAM contents), where reverting to the
|
||||||
|
* snapshot is
|
||||||
* the same as resuming from hibernation (TCP connections may have
|
* the same as resuming from hibernation (TCP connections may have
|
||||||
* timed out, but everything else picks up where it left off); or
|
* timed out, but everything else picks up where it left off); or
|
||||||
* the domain can be inactive, in which case the snapshot includes
|
* the domain can be inactive, in which case the snapshot includes
|
||||||
@ -149,7 +150,7 @@ virDomainSnapshotGetConnect(virDomainSnapshotPtr snapshot)
|
|||||||
* is not paused while creating the snapshot. This increases the size
|
* is not paused while creating the snapshot. This increases the size
|
||||||
* of the memory dump file, but reduces downtime of the guest while
|
* of the memory dump file, but reduces downtime of the guest while
|
||||||
* taking the snapshot. Some hypervisors only support this flag during
|
* taking the snapshot. Some hypervisors only support this flag during
|
||||||
* external checkpoints.
|
* external snapshots.
|
||||||
*
|
*
|
||||||
* If @flags includes VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY, then the
|
* If @flags includes VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY, then the
|
||||||
* snapshot will be limited to the disks described in @xmlDesc, and no
|
* snapshot will be limited to the disks described in @xmlDesc, and no
|
||||||
|
@ -2148,7 +2148,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Count how many snapshots in a set are external snapshots or checkpoints. */
|
/* Count how many snapshots in a set are external snapshots. */
|
||||||
static int
|
static int
|
||||||
qemuDomainSnapshotCountExternal(void *payload,
|
qemuDomainSnapshotCountExternal(void *payload,
|
||||||
const void *name ATTRIBUTE_UNUSED,
|
const void *name ATTRIBUTE_UNUSED,
|
||||||
@ -15093,7 +15093,7 @@ qemuDomainSnapshotPrepare(virDomainObjPtr vm,
|
|||||||
if ((def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && !found_internal) ||
|
if ((def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && !found_internal) ||
|
||||||
(found_internal && forbid_internal)) {
|
(found_internal && forbid_internal)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("internal snapshots and checkpoints require all "
|
_("internal and full system snapshots require all "
|
||||||
"disks to be selected for snapshot"));
|
"disks to be selected for snapshot"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -15543,7 +15543,7 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
|
|||||||
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PMSUSPENDED) {
|
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PMSUSPENDED) {
|
||||||
pmsuspended = true;
|
pmsuspended = true;
|
||||||
} else if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
} else if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
||||||
/* For external checkpoints (those with memory), the guest
|
/* For full system external snapshots (those with memory), the guest
|
||||||
* must pause (either by libvirt up front, or by qemu after
|
* must pause (either by libvirt up front, or by qemu after
|
||||||
* _LIVE converges). */
|
* _LIVE converges). */
|
||||||
if (memory)
|
if (memory)
|
||||||
@ -15771,7 +15771,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
|||||||
redefine)) {
|
redefine)) {
|
||||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
_("live snapshot creation is supported only "
|
_("live snapshot creation is supported only "
|
||||||
"with external checkpoints"));
|
"during full system snapshots"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15891,12 +15891,12 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
|||||||
} else if (virDomainObjIsActive(vm)) {
|
} else if (virDomainObjIsActive(vm)) {
|
||||||
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY ||
|
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY ||
|
||||||
snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
|
snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
|
||||||
/* external checkpoint or disk snapshot */
|
/* external full system or disk snapshot */
|
||||||
if (qemuDomainSnapshotCreateActiveExternal(driver,
|
if (qemuDomainSnapshotCreateActiveExternal(driver,
|
||||||
vm, snap, flags) < 0)
|
vm, snap, flags) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
} else {
|
} else {
|
||||||
/* internal checkpoint */
|
/* internal full system */
|
||||||
if (qemuDomainSnapshotCreateActiveInternal(driver,
|
if (qemuDomainSnapshotCreateActiveInternal(driver,
|
||||||
vm, snap, flags) < 0)
|
vm, snap, flags) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
@ -1421,7 +1421,7 @@ static const vshCmdOptDef opts_snapshot_list[] = {
|
|||||||
},
|
},
|
||||||
{.name = "active",
|
{.name = "active",
|
||||||
.type = VSH_OT_BOOL,
|
.type = VSH_OT_BOOL,
|
||||||
.help = N_("filter by snapshots taken while active (system checkpoints)")
|
.help = N_("filter by snapshots taken while active (full system snapshots)")
|
||||||
},
|
},
|
||||||
{.name = "disk-only",
|
{.name = "disk-only",
|
||||||
.type = VSH_OT_BOOL,
|
.type = VSH_OT_BOOL,
|
||||||
|
@ -4560,8 +4560,8 @@ If I<--halt> is specified, the domain will be left in an inactive state
|
|||||||
after the snapshot is created.
|
after the snapshot is created.
|
||||||
|
|
||||||
If I<--disk-only> is specified, the snapshot will only include disk
|
If I<--disk-only> is specified, the snapshot will only include disk
|
||||||
state rather than the usual system checkpoint with vm state. Disk
|
content rather than the usual full system snapshot with vm state. Disk
|
||||||
snapshots are faster than full system checkpoints, but reverting to a
|
snapshots are captured faster than full system snapshots, but reverting to a
|
||||||
disk snapshot may require fsck or journal replays, since it is like
|
disk snapshot may require fsck or journal replays, since it is like
|
||||||
the disk state at the point when the power cord is abruptly pulled;
|
the disk state at the point when the power cord is abruptly pulled;
|
||||||
and mixing I<--halt> and I<--disk-only> loses any data that was not
|
and mixing I<--halt> and I<--disk-only> loses any data that was not
|
||||||
@ -4600,10 +4600,10 @@ this. If this flag is not specified, then some hypervisors may fail
|
|||||||
after partially performing the action, and B<dumpxml> must be used to
|
after partially performing the action, and B<dumpxml> must be used to
|
||||||
see whether any partial changes occurred.
|
see whether any partial changes occurred.
|
||||||
|
|
||||||
If I<--live> is specified, libvirt takes the snapshot (checkpoint) while
|
If I<--live> is specified, libvirt takes the snapshot while
|
||||||
the guest is running. Both disk snapshot and domain memory snapshot are
|
the guest is running. Both disk snapshot and domain memory snapshot are
|
||||||
taken. This increases the size of the memory image of the external
|
taken. This increases the size of the memory image of the external
|
||||||
checkpoint. This is currently supported only for external checkpoints.
|
snapshot. This is currently supported only for full system external snapshots.
|
||||||
|
|
||||||
Existence of snapshot metadata will prevent attempts to B<undefine>
|
Existence of snapshot metadata will prevent attempts to B<undefine>
|
||||||
a persistent domain. However, for transient domains, snapshot
|
a persistent domain. However, for transient domains, snapshot
|
||||||
@ -4623,7 +4623,7 @@ Otherwise, if I<--halt> is specified, the domain will be left in an
|
|||||||
inactive state after the snapshot is created, and if I<--disk-only>
|
inactive state after the snapshot is created, and if I<--disk-only>
|
||||||
is specified, the snapshot will not include vm state.
|
is specified, the snapshot will not include vm state.
|
||||||
|
|
||||||
The I<--memspec> option can be used to control whether a checkpoint
|
The I<--memspec> option can be used to control whether a full system snapshot
|
||||||
is internal or external. The I<--memspec> flag is mandatory, followed
|
is internal or external. The I<--memspec> flag is mandatory, followed
|
||||||
by a B<memspec> of the form B<[file=]name[,snapshot=type]>, where
|
by a B<memspec> of the form B<[file=]name[,snapshot=type]>, where
|
||||||
type can be B<no>, B<internal>, or B<external>. To include a literal
|
type can be B<no>, B<internal>, or B<external>. To include a literal
|
||||||
@ -4631,7 +4631,7 @@ comma in B<file=name>, escape it with a second comma. I<--memspec> cannot
|
|||||||
be used together with I<--disk-only>.
|
be used together with I<--disk-only>.
|
||||||
|
|
||||||
The I<--diskspec> option can be used to control how I<--disk-only> and
|
The I<--diskspec> option can be used to control how I<--disk-only> and
|
||||||
external checkpoints create external files. This option can occur
|
external full system snapshots create external files. This option can occur
|
||||||
multiple times, according to the number of <disk> elements in the domain
|
multiple times, according to the number of <disk> elements in the domain
|
||||||
xml. Each <diskspec> is in the
|
xml. Each <diskspec> is in the
|
||||||
form B<disk[,snapshot=type][,driver=type][,file=name]>. A I<diskspec>
|
form B<disk[,snapshot=type][,driver=type][,file=name]>. A I<diskspec>
|
||||||
@ -4671,7 +4671,7 @@ see whether any partial changes occurred.
|
|||||||
|
|
||||||
If I<--live> is specified, libvirt takes the snapshot while the guest is
|
If I<--live> is specified, libvirt takes the snapshot while the guest is
|
||||||
running. This increases the size of the memory image of the external
|
running. This increases the size of the memory image of the external
|
||||||
checkpoint. This is currently supported only for external checkpoints.
|
snapshot. This is currently supported only for external full system snapshots.
|
||||||
|
|
||||||
=item B<snapshot-current> I<domain> {[I<--name>] | [I<--security-info>]
|
=item B<snapshot-current> I<domain> {[I<--name>] | [I<--security-info>]
|
||||||
| [I<snapshotname>]}
|
| [I<snapshotname>]}
|
||||||
|
Loading…
Reference in New Issue
Block a user