From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqQqp-0002xk-Gb for qemu-devel@nongnu.org; Wed, 02 Jan 2013 11:07:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqQql-0002JS-RD for qemu-devel@nongnu.org; Wed, 02 Jan 2013 11:07:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqQql-0002JM-JI for qemu-devel@nongnu.org; Wed, 02 Jan 2013 11:07:27 -0500 Message-ID: <50E45B3B.1090507@redhat.com> Date: Wed, 02 Jan 2013 09:07:23 -0700 From: Eric Blake MIME-Version: 1.0 References: <20120716123031.26191.29124.malonedeb@chaenomeles.canonical.com> <20121218101820.24095.3926.malone@soybean.canonical.com> <20130102155011.GA12357@stefanha-thinkpad.redhat.com> In-Reply-To: <20130102155011.GA12357@stefanha-thinkpad.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigBC41E8AD65C546658207E51C" Subject: Re: [Qemu-devel] [Bug 1025244] Re: qcow2 image increasing disk size above the virtual limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Bug 1025244 <1025244@bugs.launchpad.net>, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBC41E8AD65C546658207E51C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/02/2013 08:50 AM, Stefan Hajnoczi wrote: > On Tue, Dec 18, 2012 at 10:18:20AM -0000, Andy Menzel wrote: >> Any solution right now? I have a similar problem like Todor Andreev; >> Our daily backup of some virtual machines (qcow2) looks like that: >> >> 1. shutdown the VM >> 2. create a snapshot via: "qemu-img snapshot -c nameofsnapshot..." >> 3. boot the VM >> 4. backup the snapshot to another virtual disk via: "qemu-img convert = -f qcow2 -O qcow2 -s nameofsnapshot..." >> 5. DELETE the snapshot from VM via: qemu-img snapshot -d nameofsnapsho= t... >=20 > It's not safe to modify the qcow2 file while the guest is running. Thi= s > means Step 5 is not really safe and could result in an inconsistent > image. >=20 > This may also be causing the problem: the QEMU process has a variable > with the next free cluster index. Since Step 5 runs as a separate > process it does not update the QEMU process' next free cluster index > variable. QEMU doesn't know that there are now free clusters within th= e > image file because you updated the file behind QEMU's back - the result= > is that it grows the file. >=20 > Please try deleting the last backup snapshot between Step 1 and Step 2.= > This way you'll free the space while QEMU isn't accessing the image > file. When you boot up the image file again QEMU should reuse the free= d > clusters. You might also want to try modifying step 5 to use the HMP delvm monitor command from within the running qemu rather than going behind qemu's back with a qemu-img invocation. That's how libvirt deletes internal snapshots from a running qemu. Also, there are patches currently under review that are talking about creating a QMP counterpart to the delvm monitor command. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigBC41E8AD65C546658207E51C 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ5Fs8AAoJEKeha0olJ0NqiMoH/jlEfi1ue1pGy7ironRcsVrg x1bDPejdYAblM6pZnpzRnl4NTEE+Lu7+Z4AGAYyzFeM/jysdJeHfQdPbaPFO3Lon /daaLyIT8B45TQq0ODqMPTSPXFvzIsReAw+UdJL9dFv+sgLYbgCq9L7RBEXo1/Et mBwN0m4dNtPYVo/O4sXPQFhTPfYj9uk9l6WqBXW058dh6mZTZFEH+71rC68+r66e ZERk3NtMbzN9KJigM52EAGJerxfI3NCkcQVhcr5lf18xj1io6reY/PUDuhlqWmCd zZCDRGcu23egMpe+oPNhIsI7RAeBbOFlbeqLG+UTowkf3JkLbKpvPcm9aBEdzVE= =L9Iq -----END PGP SIGNATURE----- --------------enigBC41E8AD65C546658207E51C--