[libvirt-users] Changing path of VM configuration files

Hello, I am using shared storage and i want to keep all the configuration files of vms of different hosts in one single location (on shared storage). Is there a way i can change the default path=/etc/libvirt/qemu/<VMName>.xml to something else. I looked into libvirtd.conf and qemu.conf but could not find any such thing. -- Jatin

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 <nfshost>:/libvirt/images /var/lib/libvirt/images nfs defaults 0 0 -- Regards Soeren On 07/08/2011 01:40 AM, Jatin Kumar wrote:
Hello,I am using shared storage and i want to keep all the configuration files of vms of different hosts in one single location (on shared storage). Is there a way i can change the default path=/etc/libvirt/qemu/<VMName>.xml to something else. I looked into libvirtd.conf and qemu.conf but could not find any such thing.
-- Jatin

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@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Jatin Kumar
-
Soeren Grunewald