From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: AW: KVM backup and snapshots Date: Thu, 07 Aug 2008 11:04:04 -0500 Message-ID: <489B1CF4.7070903@codemonkey.ws> References: <90eb1dc70808070733ie9542d1t4de0f9ad0cc14df@mail.gmail.com> <90eb1dc70808070757q7c31793bjeb305c8fb662ca6e@mail.gmail.com> <90eb1dc70808070832h35f7691eref332452e029a0f3@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Javier Guerra , kvm@vger.kernel.org To: Dietmar Maurer Return-path: Received: from wx-out-0506.google.com ([66.249.82.237]:16420 "EHLO wx-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752239AbYHGQEl (ORCPT ); Thu, 7 Aug 2008 12:04:41 -0400 Received: by wx-out-0506.google.com with SMTP id h29so226596wxd.4 for ; Thu, 07 Aug 2008 09:04:39 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Dietmar Maurer wrote: >> like a 'savevm' without qcow2 requirements? >> >> would be great. >> > > Yes, something like: > > # savediff [filname] [maxsize] > > After a backup you can revert all changes, so you basically have a > snapshot. > Actually, I think a simple change to the 'change' monitor command would suffice. If it were changed to allow non-ejectable block devices to be changed atomically, perhaps with a force flag, you could do the following: qemu -hda foo.img # create temporary qcow2 file that backs to foo.img qemu-img create -f qcow2 -b foo.img tmp-hda.img # in the monitor (qemu) change -f ide0-hd tmp-hda.img # do whatever you need with foo.img (qemu) stop (qemu) commit ide0-hd # sync tmp-hda.img with foo.img (qemu) change -f ide0-hd foo.img (qemu) continue obviously, if you script it, you'll minimize downtime. We could get smarter and support a "live" commit that allowed a guest to keep running too which would make the downtime near-zero. N.B. your base image can be anything, including an LVM partition. Regards, Anthony Liguori > - Dietmar > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >