From: Eric Blake <eblake@redhat.com>
To: Vasiliy Tolstov <v.tolstov@selfip.ru>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] -loadvm and disk only snapshot
Date: Wed, 16 Dec 2015 10:35:57 -0700 [thread overview]
Message-ID: <5671A0FD.3080201@redhat.com> (raw)
In-Reply-To: <CACaajQtHidWtc5oR4KbOQ9PFEEf=6uX5Y52ribMyp2wXc=zKmg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2166 bytes --]
On 12/16/2015 10:25 AM, Vasiliy Tolstov wrote:
> 2015-12-16 19:19 GMT+03:00 Eric Blake <eblake@redhat.com>:
>> 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.
>>
>
> 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).
>
>> 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 we
>> don't regress libvirt behavior.
>
> 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).
>
> 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).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
prev parent reply other threads:[~2015-12-16 17:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 12:12 [Qemu-devel] -loadvm and disk only snapshot Vasiliy Tolstov
2015-12-16 16:19 ` Eric Blake
2015-12-16 17:25 ` Vasiliy Tolstov
2015-12-16 17:35 ` Eric Blake [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5671A0FD.3080201@redhat.com \
--to=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=v.tolstov@selfip.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.