Raoul Scarazzini
2012-Apr-26 15:13 UTC
[libvirt-users] Is there a way for telling libvirt to auto define an xml under /etc/libvirt/qemu?
Hi everybody, like in the subject: is there a way for telling libvirt to auto define an xml under /etc/libvirt/qemu? I mean, sometimes it happens to have the /etc/libvirt/qemu shared between nodes, say with a NFS share, since I can set a new xml on a node and I want o see the virtual machine on all the others, is there a way to automate this or am I obligated to launch virsh define <xml> on EACH node? Thank you so much, -- Raoul Scarazzini Solution Architect MMUL: Niente ? impossibile da realizzare, se lo pensi bene! +39 3281776712 rasca at mmul.it http://www.mmul.it
Michal Privoznik
2012-Apr-26 15:34 UTC
[libvirt-users] Is there a way for telling libvirt to auto define an xml under /etc/libvirt/qemu?
On 26.04.2012 17:13, Raoul Scarazzini wrote:> Hi everybody, > like in the subject: is there a way for telling libvirt to auto define > an xml under /etc/libvirt/qemu? I mean, sometimes it happens to have the > /etc/libvirt/qemu shared between nodes, say with a NFS share, since I > can set a new xml on a node and I want o see the virtual machine on all > the others, is there a way to automate this or am I obligated to launch > virsh define <xml> on EACH node? > > Thank you so much, >I'd say this is not supported as libvirt is not polling for changes on XML files; That's what the warning at the beginning of each XML file says. Therefore, if you change an XML from one host, the changes are likely to get overwritten by libvirt on another host when shutting libvirt down. Michal
Eric Blake
2012-Apr-26 15:37 UTC
[libvirt-users] Is there a way for telling libvirt to auto define an xml under /etc/libvirt/qemu?
On 04/26/2012 09:13 AM, Raoul Scarazzini wrote:> Hi everybody, > like in the subject: is there a way for telling libvirt to auto define > an xml under /etc/libvirt/qemu? I mean, sometimes it happens to have the > /etc/libvirt/qemu shared between nodes,*Don't do that. Ever.* Each host _must_ have their own independent /etc/libvirt/qemu directory, in order to allow proper migration between hosts. There are only a few directories specifically designed to be shared between hosts: /var/lib/libvirt/images /var/lib/libvirt/sanlock and maybe a few others that are safe to share (because libvirt only reads from, and never writes into them): /etc/libvirt/hooks Improperly sharing any other directories means that two libvirtd daemons will stomp over each other, with potentially disastrous results on both affected hosts involved in the conflicting usage. For the same reason, we recommend that you never directly edit files in /etc/libvirt, but only use defined libvirt APIs to manage changes to your domains.> say with a NFS share, since I > can set a new xml on a node and I want o see the virtual machine on all > the others, is there a way to automate this or am I obligated to launch > virsh define <xml> on EACH node?Yes, 'virsh define <xml>' on each node is the documented and supported way to maintain a persistent definition of the same domain across multiple hosts. Or you may want to look into VDSM (part of oVirt, and available in Red Hat's RHEV product), which manages definitions of domains across multiple hosts by using a common store managed by VDSM and only using transient guests when using libvirt on any one host in the managed cluster. -- Eric Blake eblake at redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 620 bytes Desc: OpenPGP digital signature URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120426/45cc9e18/attachment.sig>