On 07/08/2011 12:45 AM, Soeren Grunewald wrote:
Hallo,
the easiest way to do this, would be to mount /etc/libvirt to a
different location. e.g. using nfs.
$ cat /etc/fstab
<nfshost>:/libvirt/configs /etc/libvirt nfs defaults 0 0
Beware - doing this interferes with migrations. Each host needs an
independent location for tracking persistent configurations, otherwise
migrations will cause the destination host to stomp over the source
host's configuration before the migration is complete. Not to mention
that restarting libvirtd on one host may accidentally try to start a
guest that is already running on another host, and having two guests on
two different hosts trying to access the same disk image is a recipe for
disaster.
Rather than share /etc/libvirt, I would instead store 'virsh dumpxml'
output into a shared location, at which point you can then 'virsh
define' the same definition into any other host, without worrying about
cross-host complications.
<nfshost>:/libvirt/images /var/lib/libvirt/images nfs
defaults 0 0
However, this is safe. And with the latest libvirt 0.9.3 coupled with
sanlock (available in Fedora rawhide), you can also mount a sanlock
directory to take out leases on each disk image to ensure that no two
hosts accidentally start a guest pointing to an already in-use disk.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org