From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr7QF-00081u-3B for qemu-devel@nongnu.org; Wed, 19 Nov 2014 10:44:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr7Q7-0001An-Ay for qemu-devel@nongnu.org; Wed, 19 Nov 2014 10:43:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr7Q7-0001Ae-4e for qemu-devel@nongnu.org; Wed, 19 Nov 2014 10:43:51 -0500 Message-ID: <546CBAB5.8050202@redhat.com> Date: Wed, 19 Nov 2014 08:43:49 -0700 From: Eric Blake MIME-Version: 1.0 References: <2A6E6B95B6E5C146ACE8440760E58185BDC31A5E@EXCHANGESERVER.schefczyk.local> <546C782E.9070803@redhat.com> <2A6E6B95B6E5C146ACE8440760E58185BDC31C30@EXCHANGESERVER.schefczyk.local> <546C8200.4070800@redhat.com> <2A6E6B95B6E5C146ACE8440760E58185BDC31C70@EXCHANGESERVER.schefczyk.local> <546C84C1.5000901@redhat.com> <2A6E6B95B6E5C146ACE8440760E58185BDC31CD0@EXCHANGESERVER.schefczyk.local> <546CAF2F.4090103@redhat.com> In-Reply-To: <546CAF2F.4090103@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HbvQ8mvrLkRjGms3bCsKWAhLWKivUO4BJ" Subject: Re: [Qemu-devel] "File too large" error from "qemu-img snapshot" (was Re: AW: Bug Repoting Directions Request) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Prof. Dr. Michael Schefczyk" , qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HbvQ8mvrLkRjGms3bCsKWAhLWKivUO4BJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/19/2014 07:54 AM, Paolo Bonzini wrote: > On 19/11/2014 13:07, Prof. Dr. Michael Schefczyk wrote: >> Yes! My level of knowledge is that one uses the qcow2 format in order >> to be able to create live snapshots/backups. Otherwise one would tend >> to use the more efficient raw format. Is this not correct and did I >> apply the backup mechanism in the wrong way? >=20 > That's correct, but you still have to create live snapshots from within= > QEMU. You absolutely CANNOT modify a qcow2 file via qemu-img or any other external means while qemu is using the file in read-write mode, or you risk file corruption (which appears to be what happened to you). Monitor commands to the qemu process are the only supported means for taking a live snapshot/backup of an in-use disk. >=20 > This is done with a QMP (QEMU Management Protocol) command like >=20 > { "execute": "blockdev-snapshot-internal-sync", > "arguments": { "device": "ide-hd0", > "name": "snapshot0" } > } >=20 > QMP is accessed through normal sockets, or via libvirt. >=20 > However, I'm not sure if running "qemu-img convert" on the resulting > snapshot is possible though, and there is no equivalent of "qemu-img > snapshot -d". qemu-img snapshot -d can be achieved via the QMP monitor command 'human-monitor-command' forwarding to the HMP 'delvm' command. But you are correct that I don't know of any way to reproduce qemu-img convert on a read-write image. >=20 > You can instead use QEMU's support for backup, which will do what you > wanted directly while the VM is running. For example: >=20 > { "execute": "drive-backup", "arguments": { "device": "ide-hd0", > "sync": "full", "format": "qcow2",= > "target": "backup.img" } } >=20 > This does not even require qcow2 for the image. The downside is that > you must not turn off the VM until the job has completed. Another option is to create a live snapshot (so that your file under interest is now read-only with a temporary qcow2 overlay as the read-write file), then you can do whatever you want with the file (such as qemu-img convert), and finally do an active commit to get rid of the temporary qcow2 overlay and back to just the main live image. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --HbvQ8mvrLkRjGms3bCsKWAhLWKivUO4BJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUbLq1AAoJEKeha0olJ0NqW3sH/A8RnJ1prqXYcPW64mqXLRXX HdtbycktQhmCmPcPlmgNUM18c8j44c4dKtBpRir8zNGb823wsY4ls2Hml/oUiPMK 6D9Yn+dI6TIBHm28xwwfvTnUkBKh0kaE39TuhQQdAoJuFDg6wc0e09kwxOnjvDmt b6eLzeFiKESyhFcQ62inj8WmUI7XBVP9dl/dRYvRVNIqPdb2tgrcnsFV7SVY0GUS d+ElYKikW5NWf2bMesZF5HTASzhNMGb6M7ERn8Nw3i/BYdU+72y/I2oC/gYgM1+z tAtKGc6AQ8utBjLQl/tHhzEdD2hfjeKr5POTMbWdLUiJgHTLigtpsr2K3SdijEw= =1fv6 -----END PGP SIGNATURE----- --HbvQ8mvrLkRjGms3bCsKWAhLWKivUO4BJ--