Re: [libvirt] libvirt XML format.
On 18/02/10 05:28, Kumar L Srikanth-B22348 wrote: Now, I created a bridge br0 in the host machine with the IP 172.16.1.10. I want to assign an IP address[172.16.1.15] to the domain, so that the host machine and domain will ping each other. I tried to assign 'default' network to the domain by adding the following XML block to the above XML file: interface type='network' source network='default'/ /interface But, when I start the domain I got the following error in the virsh console: error: Failed to start domain vm1_fedora error: Failed to add veth0 device to virbr0: No such device I'm not at all familiar with LXC domains, however I think I can see the problem. The above network definition is for a managed network called 'default'. You can see its configuration using virsh. Here's mine: # virsh net-dumpxml default network namedefault/name uuid593e1d02-48b6-4ca2-ab49-8b1bca4ddb50/uuid forward mode='nat'/ bridge name='virbr0' stp='on' delay='0' / ip address='192.168.122.1' netmask='255.255.255.0' dhcp range start='192.168.122.2' end='192.168.122.254' / /dhcp /ip /network Note that the bridge is called 'virbr0'. You don't seem to have virbr0 on your system, so my guess is the default network has been stopped or unconfigured somehow. However, it doesn't sound like you want to use a managed network, you want to use your existing bridge. You need to replace your XML above with the following: interface type='bridge' source bridge='br0'/ /interface For more info have a look here: http://libvirt.org/formatdomain.html#elementsNIC Note the sections 'Virtual network' and 'Bridge to LAN'. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] libvirt XML format.
Hi, I have some doubts regarding libvirt XML format. Can anyone please let me know in detail, what is source and target tags in the libvirt XML format? Can I put '/' in the target tag or are there any exceptions if I put '/' in that? Please let me know. Regards, Srikanth. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] libvirt XML format.
On 17/02/10 12:36, Kumar L Srikanth-B22348 wrote: Hi, Hi Kumar, I have some doubts regarding libvirt XML format. Can anyone please let me know in detail, what is /source/ and /target/ tags in the libvirt XML format? The best documentation is available here: http://libvirt.org/formatdomain.html If that's not enough, could you post an example of what you're trying to do? Doesn't matter if it's wrong. Can I put '/' in the /target/ tag or are there any exceptions if I put '/' in that? The domain XML is a valid XML document. Syntactically, you can put / anywhere it would be valid in an XML document. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] libvirt XML format.
Thanks for the reply Matt. I created a Linux Container(container1) using lxc-tools. I created a Domain(container1_vm) using libvirt and want to mount that container file system in the created Domain. For that, I created following XML format: domain type='lxc' id='1' namecontainer1_vm/name memory50/memory os typeexe/type init/bin/sh/init /os vcpu1/vcpu clock offset='utc'/ on_poweroffdestroy/on_poweroff on_rebootrestart/on_reboot on_crashdestroy/on_crash devices emulator/usr/libexec/libvirt_lxc/emulator filesystem type='mount' source dir='/var/lib/lxc/container1/rootfs/rootfs'/ target dir='/'/ /filesystem console type='pty' / /devices /domain The above XML worked fine, and domain started. Now, I created a bridge br0 in the host machine with the IP 172.16.1.10. I want to assign an IP address[172.16.1.15] to the domain, so that the host machine and domain will ping each other. I tried to assign 'default' network to the domain by adding the following XML block to the above XML file: interface type='network' source network='default'/ /interface But, when I start the domain I got the following error in the virsh console: error: Failed to start domain vm1_fedora error: Failed to add veth0 device to virbr0: No such device Can you please let me know the XML format for assigning a statis IP address to the Domain? Regards, Srikanth. -Original Message- From: libvir-list-boun...@redhat.com [mailto:libvir-list-boun...@redhat.com] On Behalf Of Matthew Booth Sent: Wednesday, February 17, 2010 7:38 PM To: libvir-list@redhat.com Subject: Re: [libvirt] libvirt XML format. On 17/02/10 12:36, Kumar L Srikanth-B22348 wrote: Hi, Hi Kumar, I have some doubts regarding libvirt XML format. Can anyone please let me know in detail, what is /source/ and /target/ tags in the libvirt XML format? The best documentation is available here: http://libvirt.org/formatdomain.html If that's not enough, could you post an example of what you're trying to do? Doesn't matter if it's wrong. Can I put '/' in the /target/ tag or are there any exceptions if I put '/' in that? The domain XML is a valid XML document. Syntactically, you can put / anywhere it would be valid in an XML document. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list