Re: [Qemu-devel] [RFC]VM live snapshot proposal

2014-03-06 Thread Dr. David Alan Gilbert
* Huangpeng (Peter) (peter.huangp...@huawei.com) wrote: Hi David Where can I get your post-copy git tree? I wish to take a look into it first before start live-snapshot design. It's not yet published, as soon as it shows signs of life and I tidy it up I'll get it out there. Dave -- Dr.

Re: [Qemu-devel] [RFC]VM live snapshot proposal

2014-03-05 Thread Paolo Bonzini
Il 05/03/2014 02:00, Huangpeng (Peter) ha scritto: One question: Can post-copy fallback if exceptions happen during post-copy? What do you mean by 'exceptions' here? Generally postcopy can't fall back to precopy because once you're in postcopy mode the state is split between the two machines.

Re: [RFC]VM live snapshot proposal

2014-03-05 Thread Andrea Arcangeli
On Wed, Mar 05, 2014 at 01:52:14AM +, Huangpeng (Peter) wrote: Hi, Andrea Where can I get the dev-git-branch? I can use it to try the snapshot prototype coding. You can find the current status in the origin/master branch here http://git.kernel.org/cgit/linux/kernel/git/andrea/aa.git

Re: [RFC]VM live snapshot proposal

2014-03-05 Thread Andrea Arcangeli
Hi, On Tue, Mar 04, 2014 at 01:35:53AM +, Huangpeng (Peter) wrote: Hi Paolo, On Mon, Mar 03, 2014 at 02:47:31PM +0100, Paolo Bonzini wrote: I'm not sure what's the status of the kernel infrastructure for post-copy. Andrea? sys_userfaultfd is still work in progress but

RE: [Qemu-devel] [RFC]VM live snapshot proposal

2014-03-05 Thread Huangpeng (Peter)
Hi David Where can I get your post-copy git tree? I wish to take a look into it first before start live-snapshot design. Thanks. I'm working on post-copy at the moment, using Andrea's kernel code, using bits of Yamahata's code base as well; hopefully it won't be too long until we have

Re: [RFC]VM live snapshot proposal

2014-03-04 Thread Stefan Hajnoczi
On Tue, Mar 04, 2014 at 01:02:44AM +, Huangpeng (Peter) wrote: But back to the options: If the host has enough free memory to fork QEMU, a small helper process can be used to save the copy-on-write memory snapshot (thanks to fork(2) semantics). The hard part about the fork(2)

Re: [RFC]VM live snapshot proposal

2014-03-04 Thread Paolo Bonzini
Il 04/03/2014 09:54, Stefan Hajnoczi ha scritto: Is there any other proposals to implement vm-snapshot? See the discussion by Paolo and Andrea about post-copy migration, which adds kernel memory management features for tracking userspace page faults. Perhaps you can use that infrastructure to

Re: [Qemu-devel] [RFC]VM live snapshot proposal

2014-03-04 Thread Dr. David Alan Gilbert
* Huangpeng (Peter) (peter.huangp...@huawei.com) wrote: I think this is different in the same way that block-backup and block-mirror are different. Huangpeng's proposal would let you make a consistent snapshot of disks and RAM. Right. Though the point isn't about consistency (doing

Re: [Qemu-devel] [RFC]VM live snapshot proposal

2014-03-04 Thread Wenchao Xia
于 2014/3/4 17:05, Paolo Bonzini 写道: Il 04/03/2014 09:54, Stefan Hajnoczi ha scritto: Is there any other proposals to implement vm-snapshot? See the discussion by Paolo and Andrea about post-copy migration, which adds kernel memory management features for tracking userspace page faults. Perhaps

RE: [RFC]VM live snapshot proposal

2014-03-04 Thread Huangpeng (Peter)
Is there any other proposals to implement vm-snapshot? See the discussion by Paolo and Andrea about post-copy migration, which adds kernel memory management features for tracking userspace page faults. Perhaps you can use that infrastructure to trap guest writes. Stefan I will look into

RE: [Qemu-devel] [RFC]VM live snapshot proposal

2014-03-04 Thread Huangpeng (Peter)
Good suggestion, The latest patches of post-copy seems updated 2 years ago. https://github.com/yamahata/qemu I'm working on post-copy at the moment, using Andrea's kernel code, using bits of Yamahata's code base as well; hopefully it won't be too long until we have something to post.

RE: [RFC]VM live snapshot proposal

2014-03-04 Thread Huangpeng (Peter)
); qemu-de...@nongnu.org; Wenchao Xia; Pavel Hrdina; KVM devel mailing list; Zhanghailiang Subject: Re: [RFC]VM live snapshot proposal Hi Paolo, On Mon, Mar 03, 2014 at 02:47:31PM +0100, Paolo Bonzini wrote: I'm not sure what's the status of the kernel infrastructure for post-copy

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Stefan Hajnoczi
On Mon, Mar 03, 2014 at 01:13:41AM +, Huangpeng (Peter) wrote: Just to summarize the idea of live savevm for people joining the discussion: It should be possible to save a snapshot of the guest (including memory, devices, and disk) without noticable downtime. The 'savevm' command pauses the

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Kevin Wolf
Am 03.03.2014 um 13:32 hat Stefan Hajnoczi geschrieben: On Mon, Mar 03, 2014 at 01:13:41AM +, Huangpeng (Peter) wrote: Just to summarize the idea of live savevm for people joining the discussion: It should be possible to save a snapshot of the guest (including memory, devices, and

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Paolo Bonzini
Il 03/03/2014 13:32, Stefan Hajnoczi ha scritto: If there is not enough memory to fork, then a synchronous approach to catching guest memory writes is needed. I'm not sure if a good mechanism for that exists but the simplest would be mprotect(2) and a signal handler (which will make the guest

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Paolo Bonzini
Il 03/03/2014 13:55, Kevin Wolf ha scritto: Due to memory-modifications may happen in kvm, qemu, or vhost, the key-part is how we can provide common page-modify-tracking-and-saving api, we completed a prototype by simply add modified-page tracking/saving function in qemu, and it seems

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Kevin Wolf
Am 03.03.2014 um 14:19 hat Paolo Bonzini geschrieben: Il 03/03/2014 13:55, Kevin Wolf ha scritto: Due to memory-modifications may happen in kvm, qemu, or vhost, the key-part is how we can provide common page-modify-tracking-and-saving api, we completed a prototype by simply add

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Paolo Bonzini
Il 03/03/2014 14:30, Kevin Wolf ha scritto: So why don't we simply reuse the existing migration code? I think this is different in the same way that block-backup and block-mirror are different. Huangpeng's proposal would let you make a consistent snapshot of disks and RAM. Right. Though

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Kevin Wolf
Am 03.03.2014 um 14:47 hat Paolo Bonzini geschrieben: Il 03/03/2014 14:30, Kevin Wolf ha scritto: So why don't we simply reuse the existing migration code? I think this is different in the same way that block-backup and block-mirror are different. Huangpeng's proposal would let you make

Re: [Qemu-devel] [RFC]VM live snapshot proposal

2014-03-03 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: Il 03/03/2014 14:30, Kevin Wolf ha scritto: So why don't we simply reuse the existing migration code? I think this is different in the same way that block-backup and block-mirror are different. Huangpeng's proposal would let you make a

Re: [RFC]VM live snapshot proposal

2014-03-03 Thread Andrea Arcangeli
Hi Paolo, On Mon, Mar 03, 2014 at 02:47:31PM +0100, Paolo Bonzini wrote: I'm not sure what's the status of the kernel infrastructure for post-copy. Andrea? sys_userfaultfd is still work in progress but it shouldn't be much work left to completion. madvise(MADV_USERFAULT) and

RE: [RFC]VM live snapshot proposal

2014-03-03 Thread Huangpeng (Peter)
Yes, this is the tricky part. To be honest, I think this is the reason no one has submitted patches - it's a hard task and the win isn't that great (you can already migrate to file). Yes, lots of places have to be considered. Though scenarios are limited, users like library experiments

RE: [RFC]VM live snapshot proposal

2014-03-03 Thread Huangpeng (Peter)
Here I have another proposal, based on the live-migration scheme, add consistent memory state tracking and saving. The idea is simple: 1.First round use live-migration to save all memory to a snapshot file. 2.intercept the action of memory-modify, save old pages to a temporary

RE: [RFC]VM live snapshot proposal

2014-03-03 Thread Huangpeng (Peter)
I think this is different in the same way that block-backup and block-mirror are different. Huangpeng's proposal would let you make a consistent snapshot of disks and RAM. Right. Though the point isn't about consistency (doing the disk snapshot when memory has converged would be

RE: [RFC]VM live snapshot proposal

2014-03-03 Thread Huangpeng (Peter)
Hi Paolo, On Mon, Mar 03, 2014 at 02:47:31PM +0100, Paolo Bonzini wrote: I'm not sure what's the status of the kernel infrastructure for post-copy. Andrea? sys_userfaultfd is still work in progress but it shouldn't be much work left to completion. madvise(MADV_USERFAULT) and

[RFC]VM live snapshot proposal

2014-03-02 Thread Huangpeng (Peter)
Hi, All I found some discussion about VM live-snapshot, but haven't seen any progress. https://lists.gnu.org/archive/html/qemu-devel/2013-08/msg02125.html http://markmail.org/thread/shneezha7kmtosvb#query:+page:1+mid:shneezha7kmtosvb+state:results Here I have another proposal, based on the