Snapshots in KVM VMs (libvirt)

Here in the place some new “needs” (according to boss…) appeared for the Windows PCs and I was tasked to go full testing. I’d like to better use the Windows 10 KVM guest for all these things if possible in order to not have to rely on another different bare-metal rig.

From what tsu2 mentioned in past threads, I understood snapshots are indeed small in file size and could perhaps be what I need for these, so I went reviewing the openSUSE docs about KVM. After that, doubts arouse again.

  1. “To use virtual machine snapshots, you must have at least one non-removable and writable block device using the qcow2 disk image format.” My disk image is qcow2 indeed, but what does the rest exactly mean? I’m not being able to get it.
    And as related question, where do snapshots get saved by default? Same location as the VM image itself?

  2. The docs also mention that when taking snapshot in an already running VM, RAM is not included, unlike Proxmox. Now, I know this will sound a bit stupid, but I’d like to be sure. Both bare-metal rigs and VMs are totally alike in the sense they have nothing in their RAM when they are shutdown, right? So taking snapshot from a shutdown VM guest logically does not include anything from RAM, right?

  3. Finally, and going a bit offtopic, the way I start a VM is by first opening Virtual Machine Manager (and connecting), selecting the VM and opening the console window, closing Virtual Machine Manager so only console window is open, and finally clicking “play”. If I close console, does VM still run in “background”, in the libvirtd daemon?

I’m not in front of a KVM at the moment to double-check,
But, I can provide “general” answers that apply to a virtualization technologies…

  1. I remember when I first read the documentation you’re quoting, and I’m pretty sure it’s only saying that you want all your disk files available, and if your files are on removable storage then “things happen” – disks can be intentionally or unintentionally unmounted, physically disconnected, whatever which can break your virtual machine. Specifying a block device might be taking the requirement a bit far, any storage device likely with a recognizable file system should also be OK. Typiically when you take a snapshot, then the existing disk file(s) are locked to preserve status, and a new disk file is created for future changes.

  2. With most technologies, a file is created that holds the memory map, and it’s reserved across reboots. But, this can be disabled particularly if such files might become a security issue. Saving the memory map to file is supposed to improve fault tolerance and resiliency, for better self-recovery, but should not be an absolute requirement.

  3. This may vary between different virtualization technologies, I can only assume from my understanding of libvirt architecture that the machine should still be running without an open graphical console.

HTH and all I stated here should be double-checked but should be the case to the best of my memory and understanding,
TSU

Hope you get a chance to check…
Thanks anyway.

Excuse me, some bit help by any chance?
Thanks.

I haven’t tried snapshots, and I don’t forsee much need.

Why don’t you experiment yourself? You can create a VM to be used for such testing. And, when you are done, you can remove that VM.

After some reading it seems that, out of the 2 snapshot types internal and external, libvirt in general is limited to internal, at least as for fully supported…

Verified what I posted earlier.
No surprises or corrections.

TSU

On Tue 19 Dec 2017 07:06:02 PM CST, F style wrote:

<snip>

  1. Finally, and going a bit offtopic, the way I start a VM is by first
    opening Virtual Machine Manager (and connecting), selecting the VM and
    opening the console window, closing Virtual Machine Manager so only
    console window is open, and finally clicking “play”. If I close console,
    does VM still run in “background”, in the libvirtd daemon?

Hi
Why go to all that bother…? Just start it with virsh as root, or set
to auto-start on boot?

As user root to start, eg;


virsh start Windows_7_SP1

Domain Windows_7_SP1 started

virsh list

Id    Name                           State
----------------------------------------------------
3     Windows_7_SP1                  running

The virtual machine will keep running until it’s shutdown.

Then use virt-viewer to access the machine either remote or local…

eg, from remote machine;


virt-viewer -c qemu+ssh://<kvm_hostname_or_ip_address>/system Windows_7_SP1


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.3|GNOME 3.20.2|4.4.103-36-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!