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