[libvirt] [RFC]: Snapshot API v3

Matthias Bolte matthias.bolte at googlemail.com
Wed Mar 31 17:33:09 UTC 2010


2010/3/31 Chris Lalancette <clalance at redhat.com>:
> On 03/30/2010 08:14 PM, Matthias Bolte wrote:
>> 2010/3/30 Chris Lalancette <clalance at redhat.com>:
>>> Hello,
>>>     After our discussions about the snapshot API last week, I went ahead and implemented
>>> quite a bit of the API.  I also went back to the ESX, Virtualbox, and QEMU API's to
>>> try and make sure our API's matched up.  What's below is my revised API based on
>>> that survey.  Following my revised API are notes that I took regarding how the
>>> libvirt API matches up to the various API's, and some questions about semantics that
>>> I had while doing the survey.  More comments and questions are welcome.

>>> Mapping of our interface to various hypervisors:
>>> +-------------------------------+-----------------+-------------------+------------------------------+
>>> | Libvirt                       | Qemu            | Virtualbox        | ESX                          |
>>> +-------------------------------+-----------------+-------------------+------------------------------+
>>> | virDomainSnapshotCreateXML    | monitor command | takeSnapshot      | CreateSnapshot_task          |
>>> |                               | "savevm"; if    | Snapshots can     | takes a name, description,   |
>>> |                               | snapshot name   | be taken on       | memory (true/false) and      |
>>> |                               | is already in   | powered off,      | quiesce (true/false).        |
>>> |                               | use, replaces   | saved, running,   | What does "memory" mean?     |
>>
>> If memory is true, ESX snapshots the memory of the domain too,
>> otherwise only a disk snapshot is created.
>>
>> Creating a disk-only snapshot is nearly instant, while creating a
>> memory snapshot also requires a notable amount of time to write the
>> memory image to disk.
>
> Sorry, I misread the documentation yesterday.  That's fairly clear.
> What's less clear to me is what happens when you take a disk-only snapshot,
> and then try to RevertToSnapshot from a running VM.  What happens in that case?

If the domain is running and you revert to a disk-only snapshot then
the domain gets shutdown. Or rephrased: the power state associated
with a disk-only snapshot is always powered-off, even if the domain
was running while the disk-only snapshot was created.

>>
>>> |                               | the previous    | or paused VMs.    | Should we model "quiesce"    |
>>
>> The vSphere API docs give a good description what the quiesce option does:
>>
>> "If TRUE and the virtual machine is powered on when the snapshot is
>> taken, VMware Tools is used to quiesce the file system in the virtual
>> machine. This assures that a disk snapshot represents a consistent
>> state of the guest file systems. If the virtual machine is powered off
>> or VMware Tools are not available, the quiesce flag is ignored."
>>
>> I assume "quiesce the file system" means to flush write caches and
>> stuff like that.
>>
>> This option is important if you want to create a disk-only snapshot of
>> a running domain.
>
> Exactly.  I'm not sure this is going to be possible in general (and
> I guess it's not even really possible in ESX unless you install VMware
> Tools inside the guest).  I'm inclined not to model it at the moment,
> although I could be convinced otherwise.

Yes, quiesce requires VMware Tools to be installed in the guest.

Matthias




More information about the libvir-list mailing list