From: Kevin Wolf <kwolf@redhat.com>
To: edison <disheng.su@gmail.com>
Cc: edison <edison@cloud.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] [RFC] savevm only saves disk state
Date: Thu, 16 Sep 2010 12:03:43 +0200 [thread overview]
Message-ID: <4C91EB7F.2010300@redhat.com> (raw)
In-Reply-To: <AANLkTinoKx9Agj6KDMhM4BoELU0OyoMqBiuwWTT_9bmm@mail.gmail.com>
Am 15.09.2010 20:24, schrieb edison:
> On Thu, Sep 9, 2010 at 7:08 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
>> On 09/09/2010 08:43 PM, disheng.su@gmail.com wrote:
>>>
>>> From: edison<edison@cloud.com>
>>>
>>> Add a new option when "savevm": savevm -n snapshotName, which only takes
>>> snapshot on disk, but doesn't save vm state(memory,cpu,devices...).
>>> Saving vm state on QCOW2 disk will take a long time, per my test, it will
>>> take 1~2 minutes to "savevm" on VM with 1G memory. Even worse, the VM is
>>> wholely stopped at that time, makes "savevm" not that useful.
>>> All we know the side effect of it:) but does it make sense to give user
>>> the choice?
>>>
>>
>> I think it would be better to explore ways to make savevm live. A round
>> about option would be to combine a disk-only snapshot with a live migration
>> to disk and somehow allow qcow2 to refer to an external memory snapshot.
>>
>
> My point is we still need an interface to take online snapshot for
> disk-only(flush pending I/O, take QCOW2 snapshot, no savevm, no live
> migration), which is the fastest , lowest down time and easy to
> manage.
> Look like VMware supports such kind of operation: take a snapshot
> without saving memory(http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1015180).
>
> Of cause, it's better to cooperate with pv driver, or tools inside
> guest, which can hold I/O, flush disk cache, etc. If without such
> co-operation, the bare disk snapshot is just like saving the disk
> state when loosing power, not that bad, right?
I agree that disk-only snapshots probably have their place. We already
create them with qemu-img snapshot -c, so I think it would be
appropriate to expose the option in the monitor, too.
>> A better alternative would be a live snapshot within qcow2. I think Kevin
>> has some good ideas about how to do this with qcow2 today but provided we
>> had a nice interface to do this, the changes to the live migration code
>> should be fairly straight forward.
>
> Hi Kevin, any idea about it? Live snapshot is very useful. Do you
> already have ideas/plans about it? I want to take a look at it, make
> it live!
I haven't taken a very close look at this yet, but in theory it should
be really straightforward.
The one thing you need to know is how VM state is saved in qcow2: It is
stored just like the normal data on the virtual disk, but at offsets
greater than the virtual size of the disk, so that guests don't see it.
For example if you have an 8 GB image (virtual size), the VM state might
start at 10 GB.
Currently when you do a savevm, we save the state of all these devices
to the VM state area (using bdrv_save_vmstate()) and then take a disk
snapshot (which magically includes the VM state, because it's just some
data on the disk).
So when making snapshots live, what you need to do is basically a live
migration into this part of the virtual disk (should be very similar to
migrating into an external file, which is possible today). Once the VM
state is saved to the virtual disk, you can take the good old disk
snapshot and you're done.
Kevin
prev parent reply other threads:[~2010-09-16 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 1:43 [Qemu-devel] [PATCH] [RFC] savevm only saves disk state disheng.su
2010-09-10 2:08 ` Anthony Liguori
2010-09-15 18:24 ` edison
2010-09-16 10:03 ` Kevin Wolf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C91EB7F.2010300@redhat.com \
--to=kwolf@redhat.com \
--cc=disheng.su@gmail.com \
--cc=edison@cloud.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.