[libvirt-users] Changing path of VM configuration files

Eric Blake eblake at redhat.com
Fri Jul 8 13:25:03 UTC 2011


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 at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20110708/5061d91e/attachment.sig>


More information about the libvirt-users mailing list