[libvirt-users] domain definition storage

Hi, I defined several xen domains with libvirt. Can anybody tell me where libvirt stores these definitions? E.g. what files would one need to back up? Is it correct, that the xen domain definitions in /var/lib/xend/domains are overwritten regularly by libvirt? Many thanks, Arik

On Tue, Jan 26, 2010 at 08:00:19PM +0100, Arik Raffael Funke wrote:
Hi,
I defined several xen domains with libvirt. Can anybody tell me where libvirt stores these definitions? E.g. what files would one need to back up?
Is it correct, that the xen domain definitions in /var/lib/xend/domains are overwritten regularly by libvirt?
libvirt never directly stores its XML files when talking to Xen - it always uses one of the two Xen formats as the master database instead. On Xen <= 3.0.3 libvirt uses the files in /etc/xen On Xen > 3.0.3 libvirt uses the native Xen APIs, which result in the files being stored in /var/lib/xend/domains instead. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Hi Daniel,
libvirt never directly stores its XML files when talking to Xen - it always uses one of the two Xen formats as the master database instead. ...snipp... On Xen> 3.0.3 libvirt uses the native Xen APIs, which result in the files being stored in /var/lib/xend/domains instead.
So if I change the files in /var/lib/xend/domains manually, the changes should stick, right? I tried that and occasionally the files revert to the previous version. Could it be that the respective VM (or virt-manager?) must not be running while changing the domain configuration files? Does libvirt or xen store the domain configuration in memory while the machine/gui is running and write it back to the configuration file when the machine/gui shuts down? Thank, Arik

On Tue, Jan 26, 2010 at 09:51:00PM +0100, Arik Raffael Funke wrote:
Hi Daniel,
libvirt never directly stores its XML files when talking to Xen - it always uses one of the two Xen formats as the master database instead. ...snipp... On Xen> 3.0.3 libvirt uses the native Xen APIs, which result in the files being stored in /var/lib/xend/domains instead.
So if I change the files in /var/lib/xend/domains manually, the changes should stick, right? I tried that and occasionally the files revert to the previous version.
No, XenD gets very unhappy if you change those files manually and will freely overwrite your changes.
Could it be that the respective VM (or virt-manager?) must not be running while changing the domain configuration files? Does libvirt or xen store the domain configuration in memory while the machine/gui is running and write it back to the configuration file when the machine/gui shuts down?
If you want to update the guest config, you should always do it via the libvirt APIs, or virsh tool, eg 'virsh define GUEST.xml' or 'virsh edit GUESTNAME'. This ensures that XenD itself is always informed of the changes. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Arik Raffael Funke
-
Daniel P. Berrange