Correctly installing / configuring locally built qemu / libvirt

On Ubuntu 18.04, the default installation of qemu is something like version 3, and I needed virtiofs which has built-in support in later versions. So I uninstalled the qemu and related packages, downloaded the qemu 5.0 sources and complied it locally.

All worked well, including make install, which put the binaries in /usr/local/ which I guess is the correct default unless told otherwise.

Most things are working OK, but I’m now trying to get graceful shutdown / restart of guests working when the host is restarted, and have hit 2 snags so far.

  1. On host startup, I would see /usr/local/libexec/libvirt-guests.sh: 29: .: Can't open /usr/local/bin/gettext.sh. Of course, that’s not where getttext.sh normally lives, but I can get round that by ln -s /usr/bin/gettext.sh /usr/local/bin/gettext.sh
  2. No failure message there now, but later in the host boot logs I see libvirt-guests.sh[2166]: touch: cannot touch '/usr/local/var/lock/subsys/libvirt-guests': No such file or directory

I could go on symlinking things so they appear accessible to libvirt, but I’m wondering if the correct fix is actually to install qemu where it expects to be.

So, first question, is reinstalling the right approach, or have I just missed some basic configuration which would leave the local package where it is, but allow everything to work as expected?

If not, I guess I will have to run ./configure --prefix=/usr and rebuild, but how could I remove the currently installed version in /usr/local/ cleanly first? And, I’d ideally like to keep my current VM configurations. Searching for an XML file for a particular domain, I see 2 versions:

# find / -name 07x2.xml
/usr/local/var/run/libvirt/qemu/07x2.xml
/usr/local/etc/libvirt/qemu/07x2.xml

I’m not sure why there are 2, but I guess I could just virsh dumpxml before removing anything.

Go to Source
Author: dsl101

How would you (incrementally) backup KVM VMs based on LVM storage?

I’m running a set of KVM hypervisors on LVM storage (unfortunately I can’t use QCOW2, because the virtualization platform I’m using is strictly LVM-based).

The virtualization platform has a very poor backup support, so I wrote a series of scripts which perform LVM snapshots, grab the image with qemu-image, compress and store it on a separate storage.

My scripts work well enough, but with increasing number of VMs and data to manage are beginning to show their limits.

Can someone suggest me a free or commercial solution to have the work done well?
This is what I’m doing now and what I need to do:

  • scheduled backups
  • daily and weekly rotation and retention
  • backup saved on external storage
  • restore system
  • (extra points for incremental backup)

The VMs are both Linux and Windows, so I can’t rely on the internal filesystem.

I don’t need a web UI or other frills, CLI management is enough.

Go to Source
Author: godzillante