* [Qemu-devel] -loadvm and disk only snapshot
@ 2015-12-16 12:12 Vasiliy Tolstov
2015-12-16 16:19 ` Eric Blake
0 siblings, 1 reply; 4+ messages in thread
From: Vasiliy Tolstov @ 2015-12-16 12:12 UTC (permalink / raw)
To: qemu-devel
Hi. I'm try to find some info how to run qemu vm from snapshot, but
all pages contains info about running vm from full vm snapshot with
memory state.
What happening when i'm run qemu with -loadvm from disk only snapshot
(created byblockdev-snapshot-internal-sync)?
--
Vasiliy Tolstov,
e-mail: v.tolstov@selfip.ru
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] -loadvm and disk only snapshot
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
0 siblings, 1 reply; 4+ messages in thread
From: Eric Blake @ 2015-12-16 16:19 UTC (permalink / raw)
To: Vasiliy Tolstov, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
On 12/16/2015 05:12 AM, Vasiliy Tolstov wrote:
> Hi. I'm try to find some info how to run qemu vm from snapshot, but
> all pages contains info about running vm from full vm snapshot with
> memory state.
> What happening when i'm run qemu with -loadvm from disk only snapshot
> (created byblockdev-snapshot-internal-sync)?
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.
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.
--
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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] -loadvm and disk only snapshot
2015-12-16 16:19 ` Eric Blake
@ 2015-12-16 17:25 ` Vasiliy Tolstov
2015-12-16 17:35 ` Eric Blake
0 siblings, 1 reply; 4+ messages in thread
From: Vasiliy Tolstov @ 2015-12-16 17:25 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel
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.
> 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.
--
Vasiliy Tolstov,
e-mail: v.tolstov@selfip.ru
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] -loadvm and disk only snapshot
2015-12-16 17:25 ` Vasiliy Tolstov
@ 2015-12-16 17:35 ` Eric Blake
0 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2015-12-16 17:35 UTC (permalink / raw)
To: Vasiliy Tolstov; +Cc: qemu-devel
[-- 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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-12-16 17:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).