From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Fzn-0000dn-1P for qemu-devel@nongnu.org; Wed, 16 Dec 2015 12:36:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9Fzi-0008QX-3O for qemu-devel@nongnu.org; Wed, 16 Dec 2015 12:36:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Fzh-0008QS-NM for qemu-devel@nongnu.org; Wed, 16 Dec 2015 12:36:06 -0500 References: <56718F0C.5070809@redhat.com> From: Eric Blake Message-ID: <5671A0FD.3080201@redhat.com> Date: Wed, 16 Dec 2015 10:35:57 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IVW5hSvvKmo4BqsDo5vC04QPseXrxMNA9" Subject: Re: [Qemu-devel] -loadvm and disk only snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vasiliy Tolstov Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IVW5hSvvKmo4BqsDo5vC04QPseXrxMNA9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/16/2015 10:25 AM, Vasiliy Tolstov wrote: > 2015-12-16 19:19 GMT+03:00 Eric Blake : >> Won't work (qemu is not able to load disk snapshots without memory). >> What libvirt does instead is to use qemu-img snapshot -c to change the= >> snapshot back to the active layer, then boot qemu fresh on the correct= >> contents. >> >=20 > qemu-img snapshot -a ? as i see -c creates new snapshot. Oh, right. The apply operation (not the create operation) (I had in my mind 'revert', but there is no 'snapshot -r', so I must have been thinking '-c' meant 'change', without actually reading the full text. Moral of the story - one-letter mnemonics are not always the best command line interface). >=20 >> Of course, patches to change behavior aren't out of the question, but >> there's already a lot of cruft there to be aware of, and making sure w= e >> don't regress libvirt behavior. >=20 > My needed use case - create multilayered qcow2 image. Base layer - > clean fresh (for example debian) system, next layer - LAMP, next layer > RAILS (base on top of clean debian system) and so on. > I want to create images from packer and want to write packer plugin > for this case (installer that able to read from qcow2 file i create > later). >=20 > Does it possible with qemu-img snapshots with my use case? I don't > want to snapshot memory because i don't need it. To get consistent > snapshots i can sync disk or freeze fs by ioctl. Yes, you can create chains of backing files at known points of time in system installation, and then revert to booting back from that known point of time, by using qemu-img commands. Creating your known points of time where the guest is powered off, rather than trying to freeze fs but discard the memory associated with that point of time, is probably cleaner. You may also want to investigate if existing tools already do what you need (libguestfs provides quite a few tools for provisioning templates that can then be used to fire up easy clones from that point in time). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IVW5hSvvKmo4BqsDo5vC04QPseXrxMNA9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWcaD9AAoJEKeha0olJ0Nq3RwH/3oMiyXuHkJ4OtA90G1FmWEY +TqUO2gyXbcSseW7GNNvSqODWfbt2X/7higgMS7UyB47RXmAJSQJW4z0p+KzDUja HMIhNxwQp/DAbzBhbViTIL0XoUVvDv+C87dceq2NFYWcYTFXiPAOMr1T/lK5i8bt TwL6JA/DbvanpeXRusDhKD9m/ihvTTq0HrAvmV6aIVRFE/P5AOzG7xrP5mnTmzY9 WZaQpuGfenDLTvHV89UAYRHKTccgw7+U8/RtnVzbmV8jlyUi1uGUOrhdX87i5I47 O5VQaKIMYwnzYwDNei6E7iASpczCHY0I/l7DUAAw/xHqknmUWy0LvBjxaQeKx/o= =hIxR -----END PGP SIGNATURE----- --IVW5hSvvKmo4BqsDo5vC04QPseXrxMNA9--