qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] -loadvm and disk only snapshot


From: Eric Blake
Subject: Re: [Qemu-devel] -loadvm and disk only snapshot
Date: Wed, 16 Dec 2015 10:35:57 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/16/2015 10:25 AM, Vasiliy Tolstov wrote:
> 2015-12-16 19:19 GMT+03:00 Eric Blake <address@hidden>:
>> 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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]