3

Assume a KVM/QEMU VM, which uses qcow/qcow2 as the image format for virtual disks. Backup is (to be) done on the VM host.

As far as my current understanding goes is that while we can create backups from the vm right out of the box using snapshots (with LVM, for example), these backups are merely crash-consistent, which is really not appropiate IMHO. Also, upon closer inspection, a lot of the tools and scripts currently floating around are doing exactly that - so either the authors were lazy or missed some fundamentals, or I'm completely wrong about the whole show.

My current solution is to call fsfreeze (or use the device-mapper) in the vm, prior taking the snapshot on the host.

However, how do I do this elegantly from the host? Using the virtio channel, speaking to qemu-ga or using QMP; they all seem to be in their infancy, highly asynchronous, and furthermore, it seems nothing is guaranteed to come through.

Am I really required to manually log into the VM's? Are there no tools handling this properly already existing ? (There are a lot of features proposed for QEMU, but I couldn't find any [decent] doc's on implemented features relating to this).

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
Roman
  • 3,907
  • 3
  • 21
  • 34

1 Answers1

3

What you are talking about is a function of the QEMU Guest Agent, or qemu-ga in short. Please take a look at https://wiki.qemu.org/Features/GuestAgent

Brian Z
  • 103
  • 3
dyasny
  • 18,802
  • 6
  • 49
  • 64
  • I already knew about it, however, *as described above* it doesn't seem really stable to me (also refer to http://git.qemu.org/?p=qemu.git;a=blob;f=qapi-schema-guest.json;h=d955cf11fb3c1320a263f88b9dac4618c53e63a0;hb=HEAD). Do you have any experience using it? – Roman Jul 09 '13 at 07:07
  • Your answer led me into the right direction. After reading much more, I'm now convinced that it's stable and the right way to do. – Roman Jul 09 '13 at 08:46
  • glad you found it useful. qemu-ga is the officially correct way of doing this, although you could of course write something of your own – dyasny Jul 09 '13 at 18:37