Re: Restoring a QEMU snapshot

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

 



On 03/29/2017 09:40 AM, Patrick O'Callaghan wrote:
On Wed, 2017-03-29 at 08:44 -0500, Robert Nichols wrote:
"Backing file" implies "qemu-img create -b ...". I agree that the manpage is horribly unclear. The snapshots from "qemu-img snapshot {-c|-a|-d}" are not separate files. They are maintained _within_ that single image file. The two constructs are very different.

A backing file can have multiple dependent images, and all can be active simultaneously. That setup is typically used when you want to have multiple independent Windows 10 VMs (for example) all running simultaneously, probably for different users. It's like having separate copies of the base image, but each VM only uses disk space to record the _differences_ from that backing file. That backing file can never be changed while any dependent image exists, so the way it might be handled would be to create the dependent image anew when the user connects and give that user persistent storage elsewhere.

A qemu-img snapshot, OTOH, maintains a record of the state the base image was in at a point in time. A snapshot is _never_ "active" and cannot be written to. There can be multiple snapshots, each representing what was in the base image at the time the snapshot was created. It is like having read-only copies of the base image, but with each needing only enough disk space for the information needed to undo whatever changes occurred in the base image since the snapshot was created. The only way to access the content of a snapshot is to run "qemu-img snapshot -a ...", which is saying, "Make the base image look like it was when this snapshot was created."

It can be quite hard to understand until you have played with it for a bit. Note that LVM snapshots are a third variant, and are quite different from either of the above. With LVM snapshots, both the base and the snapshot can be simultaneously active read/write, with the snapshot keeping track of the differences.


OK, I think I get the idea. The manpage is not only unclear, it's
actually inconsistent with what you say. There is no mention of a '-b'
option to 'create'. The --help option doesn't say anything about it
either, but I tried it and it works.

Indeed! The manpage does say, "If the option backing_file is specified, ..." in the section for the "create" command, but does not, in that section, mention how to specify it.

...

OK, once I've created the backing file, how do I use it? I've been
running virt-manager for everything but it's not clear how to do this.
Do I need to run qemu-kvm from the command line?

You don't _create_ the backing file. You _use_ an existing image _as_ a backing file. What you create is a new file, let's call it a "virtual image", which you can then use just like any other disk image in a VM. If you're using virt-manager, you can create a new VM and select "Import existing disk image" as the source. Or, you can edit your existing VM instance and substitute the new "virtual image" file for whatever it is using now.

--
Bob Nichols     "NOSPAM" is really part of my email address.
                Do NOT delete it.
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux