Received: from [140.186.70.92] (port=49749 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pxlyu-0004Vi-Hn for qemu-devel@nongnu.org; Thu, 10 Mar 2011 14:57:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pxlyt-0005iY-0U for qemu-devel@nongnu.org; Thu, 10 Mar 2011 14:57:08 -0500 Received: from web161602.mail.bf1.yahoo.com ([98.139.210.171]:34860) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Pxlys-0005iR-Ps for qemu-devel@nongnu.org; Thu, 10 Mar 2011 14:57:06 -0500 Message-ID: <102956.23165.qm@web161602.mail.bf1.yahoo.com> Date: Thu, 10 Mar 2011 11:57:05 -0800 (PST) From: SAURAV LAHIRI Subject: Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qemu 0.14.0 In-Reply-To: <4D78A0E8.7000606@redhat.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-708760848-1299787025=:23165" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , Jes Sorensen Cc: qemu-devel@nongnu.org --0-708760848-1299787025=:23165 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thank you Stefan and Jes for providing further inputs. Details on use case: The high level use case is that of being able to backup user specified disk= s of a VM without having to bring down the VM.=20 That was the reason that I had started of with running the "qemu-img snapsh= ot -c snap1..." on a running vm. So when I have a snapshot i can back this = up. Without a frozen and consistent snapshot, backing up the qcow2 disk ima= ge would cause serious issues on restore. But after your inputs shelved the= plans of creating snapshot on running vm. So next approach planned did take into account that=A0 I have to shutdown t= he VM for creating the snapshot. It would appear that, since the internal s= napshot creation is an instantaneous process I could bring down the vm, cre= ate an internal snapshot, bring up the VM. and this entire thing would take= a minimal time.=20 Once the VM is up I can continue with converting the internal snapshot to a= n external snapshot and then back up the external snapshot to my backup loc= ation. The duration of conversion from internal to external obviously would= depend on the size of the original qcow2 disk. But since the VM is up the = duration would not concern me much as long as it completes within some prac= tical time limits. snapshot_blkdev: Regarding this=A0 I do have a couple of questions. 1. If the snapshot cannot be merged then it could mean that there are sever= al snapshot files. One readonly=A0 for each of the previous snapshots and t= he last one being the active one, which handles all the current writes. Pos= t backup If do have to restore to a particular snapshot then i would probab= ly have to copy all the files in the chain and maintain the entire chain. B= ut would it not affect read performance if several snapshot files are maint= ained, particularly if the VM is hosting a database like mysql ? Could you = please clarify. 2. I have seen that at times the qemu monitor command is not able to connne= ct to=A0 the monitor socket as libvirt it seems controls the monitor socket= . If I shutdown libvirt then commands like socat is able to connect. But si= nce my current environment does use libvirt, shutting down libvirt is not a= n option. Is there any way around this ? Appreciate your help. Regards sl --- On Thu, 10/3/11, Jes Sorensen wrote: From: Jes Sorensen Subject: Re: [Qemu-devel] Issue with snapshot outside qcow2 disk - qemu 0.1= 4.0 To: "Stefan Hajnoczi" Cc: "SAURAV LAHIRI" , qemu-devel@nongnu.org Date: Thursday, 10 March, 2011, 5:59 On 03/10/11 10:58, Stefan Hajnoczi wrote: > On Thu, Mar 10, 2011 at 9:32 AM, Jes Sorensen w= rote: >> On 03/10/11 10:27, Stefan Hajnoczi wrote: >>> I have CCed Jes who has been working on a live snapshot mechanism.=A0 H= e >>> recently added the snapshot_blkdev monitor command that takes a >>> snapshot of a block device while the VM is running.=A0 A new image file >>> is created based off the original image file (which will no longer be >>> modified), all new disk writes go to the new image file.=A0 It is safe >>> to perform read-only access to the original image file.=A0 There >>> currently is no support to merge the snapshot changes back into the >>> original image while the VM is running, but I think that is the next >>> planned step. >> >> Yes, keep in mind that the live snapshot is only for external snapshot >> files, it doesn't deal with internal snapshots. >=20 > Yep, that's why I'm interested in Saurav's use case.=A0 Many use cases > work with either internal or external snapshot but it depends on the > details. Actually I think there's very little reason to keep internal snapshot support. It doesn't buy us much, but it adds unnecessary complexity. Cheers, Jes =0A=0A=0A --0-708760848-1299787025=:23165 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Thank you Stefan and Jes for providing furthe= r inputs.

Details on use case:

The high level use case is tha= t of being able to backup user specified disks of a VM without having to br= ing down the VM.

That was the reason that I had started of with run= ning the "qemu-img snapshot -c snap1..." on a running vm. So when I have a = snapshot i can back this up. Without a frozen and consistent snapshot, back= ing up the qcow2 disk image would cause serious issues on restore. But afte= r your inputs shelved the plans of creating snapshot on running vm.

= So next approach planned did take into account that  I have to shutdow= n the VM for creating the snapshot. It would appear that, since the interna= l snapshot creation is an instantaneous process I could bring down the vm, = create an internal snapshot, bring up the VM. and this entire thing would t= ake a minimal time.

Once the VM is up I can continue with converting t= he internal snapshot to an external snapshot and then back up the external = snapshot to my backup location. The duration of conversion from internal to= external obviously would depend on the size of the original qcow2 disk. Bu= t since the VM is up the duration would not concern me much as long as it c= ompletes within some practical time limits.


snapshot_blkdev: Reg= arding this  I do have a couple of questions.

1. If the snapsho= t cannot be merged then it could mean that there are several snapshot files= . One readonly  for each of the previous snapshots and the last one be= ing the active one, which handles all the current writes. Post backup If do= have to restore to a particular snapshot then i would probably have to cop= y all the files in the chain and maintain the entire chain. But would it no= t affect read performance if several snapshot files are maintained, particularly if the VM is hosting a database like mysql ? Could you please= clarify.

2. I have seen that at times the qemu monitor command is n= ot able to connnect to  the monitor socket as libvirt it seems control= s the monitor socket. If I shutdown libvirt then commands like socat is abl= e to connect. But since my current environment does use libvirt, shutting d= own libvirt is not an option. Is there any way around this ?

Appreci= ate your help.

Regards
sl









=
--- On Thu, 10/3/11, Jes Sorensen <Jes.Sorensen@redhat.com>= wrote:

From: Jes Sorensen <Jes.= Sorensen@redhat.com>
Subject: Re: [Qemu-devel] Issue with snapshot ou= tside qcow2 disk - qemu 0.14.0
To: "Stefan Hajnoczi" <stefanha@gmail.= com>
Cc: "SAURAV LAHIRI" <saurav_lahiri@yahoo.com>, qemu-devel@nongnu.org
Date: Thursday, 10 March, 2011, 5:59

On 03/10/11 10:58, Stefan Hajnoczi wrote:
> On Th= u, Mar 10, 2011 at 9:32 AM, Jes Sorensen <Jes.Soren= sen@redhat.com> wrote:
>> On 03/10/11 10:27, Stefan Hajnocz= i wrote:
>>> I have CCed Jes who has been working on a live sna= pshot mechanism.  He
>>> recently added the snapshot_blkde= v monitor command that takes a
>>> snapshot of a block device w= hile the VM is running.  A new image file
>>> is created b= ased off the original image file (which will no longer be
>>> m= odified), all new disk writes go to the new image file.  It is safe>>> to perform read-only access to the original image file. = There
>>> currently is no support to merge the snapshot change= s back into the
>>> original image while the VM is running, but = I think that is the next
>>> planned step.
>>
>&= gt; Yes, keep in mind that the live snapshot is only for external snapshot<= br>>> files, it doesn't deal with internal snapshots.
>
>= ; Yep, that's why I'm interested in Saurav's use case.  Many use cases=
> work with either internal or external snapshot but it depends on t= he
> details.

Actually I think there's very little reason to k= eep internal snapshot
support. It doesn't buy us much, but it adds unnec= essary complexity.

Cheers,
Jes


=0A=0A=0A=0A --0-708760848-1299787025=:23165--