
Hello, I'm having trouble digging up some documentation on libvirt's network config. I'm not sure where to set this up, but I have a bridged device br0 that I would like to have available in virt-manager/virsh. Right now, I can edit the VM's xml interface element manually to use br0. Virt-manager has an option for shared physical device, but it's empty, and I can't figure out how to see it from virsh. thanks -jim

James Bardin wrote:
I'm not sure where to set this up, but I have a bridged device br0 that I would like to have available in virt-manager/virsh.
Right now, I can edit the VM's xml interface element manually to use br0.
AFAIK, you're doing the right thing (as long as you're doing a "dump-xml" to get the XML description out and then a "define" to put the updated one in; directly modifying /etc/libvirt/qemu/* is bad form). Personally, I use xmlstarlet [from shell scripts] or lxml [from python] to automate tweaking the XML host descriptions, but the details are your own call.

Charles Duffy wrote:
James Bardin wrote:
I'm not sure where to set this up, but I have a bridged device br0 that I would like to have available in virt-manager/virsh.
Right now, I can edit the VM's xml interface element manually to use br0.
AFAIK, you're doing the right thing (as long as you're doing a "dump-xml" to get the XML description out and then a "define" to put the updated one in; directly modifying /etc/libvirt/qemu/* is bad form).
Yeah, that's what I am doing. I can't seem to figure out what to do to get br0 configured in libvirt, so that it can managed through virsh/virt-manager. Right now I'm resorting to creating a vm with the default adapter, then modifying the adapter in /etc/libvirt/qemu/*.xml.

On Tue, Aug 19, 2008 at 04:12:06PM -0500, Charles Duffy wrote:
James Bardin wrote:
I'm not sure where to set this up, but I have a bridged device br0 that I would like to have available in virt-manager/virsh.
Right now, I can edit the VM's xml interface element manually to use br0.
AFAIK, you're doing the right thing (as long as you're doing a "dump-xml" to get the XML description out and then a "define" to put the updated one in; directly modifying /etc/libvirt/qemu/* is bad form).
Personally, I use xmlstarlet [from shell scripts] or lxml [from python] to automate tweaking the XML host descriptions, but the details are your own call.
As a completely separate aside to this, in the new version of libvirt (either CVS or 0.4.5 whenever that is released) you will be able to do: virsh edit <domain|ID|UUID> virsh net-edit <network> virsh pool-edit <storage> These do the dumpxml/edit/define sequence of operations, and have sensible behaviour in the case of failure. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 60 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

James Bardin wrote:
Hello,
I'm having trouble digging up some documentation on libvirt's network config.
I'm not sure where to set this up, but I have a bridged device br0 that I would like to have available in virt-manager/virsh.
Right now, I can edit the VM's xml interface element manually to use br0. Virt-manager has an option for shared physical device, but it's empty, and I can't figure out how to see it from virsh.
cc-ing et-mgmt-tools which is the virt-manager list The bridge should be showing up in shared physical device drop down automatically, there shouldn't be anything you need to teach libvirt. What virt-manager version are you using? Distro? Is there anything showing up in the shared device drop down (even if you can't select it?) Also if you could attach ~/.virt-manager/virt-manager.log it might help. Thanks, Cole

Cole Robinson wrote:
What virt-manager version are you using? Distro?
libvirt: 0.4.0-2ubuntu8 virt-manager: 0.5.3-0ubuntu10 Distro: Ubuntu 8.04.1 server x86_64
Is there anything showing up in the shared device drop down (even if you can't select it?)
The drop-down activates, but is empty.
Also if you could attach ~/.virt-manager/virt-manager.log it might help.
This group popped up a lot yesterday: [Tue, 19 Aug 2008 14:55:19 virt-manager 5811] WARNING (connection:494) Unable to list active networks [Tue, 19 Aug 2008 14:55:19 virt-manager 5811] WARNING (connection:498) Unable to list inactive networks [Tue, 19 Aug 2008 14:55:19 virt-manager 5811] ERROR (engine:158) Could not refresh connection qemu:///system <class 'libvirt.libvirtError'> virConnectListDomainsID() failed Broken pipe Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/engine.py", line 152, in _tick self.connections[uri]["connection"].tick() File "/usr/share/virt-manager/virtManager/connection.py", line 550, in tick newActiveIDs = self.vmm.listDomainsID() File "/usr/lib/python2.5/site-packages/libvirt.py", line 795, in listDomainsID if ret is None: raise libvirtError ('virConnectListDomainsID() failed', conn=self) libvirtError: virConnectListDomainsID() failed Broken pipe Here's the output when I try to add a new network device: [Wed, 20 Aug 2008 10:57:39 virt-manager 6673] ERROR (connection:158) Unable to connect to HAL to list network devices: '%s'<class 'dbus.exceptions.DBusException'> org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/connection.py", line 144, in detect_network_devices hal_object = self.bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager') File "/var/lib/python-support/python2.5/dbus/bus.py", line 244, in get_object follow_name_owner_changes=follow_name_owner_changes) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 241, in __init__ self._named_service = conn.activate_name_owner(bus_name) File "/var/lib/python-support/python2.5/dbus/bus.py", line 183, in activate_name_owner self.start_service_by_name(bus_name) File "/var/lib/python-support/python2.5/dbus/bus.py", line 281, in start_service_by_name 'su', (bus_name, flags))) File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking message, timeout) DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files [Wed, 20 Aug 2008 10:57:47 virt-manager 6673] ERROR (console:106) Cannot initialize notification systemorg.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute dbus-launch to autolaunch D-Bus session Thanks -jim

James Bardin wrote:
Cole Robinson wrote:
What virt-manager version are you using? Distro?
libvirt: 0.4.0-2ubuntu8 virt-manager: 0.5.3-0ubuntu10
Distro: Ubuntu 8.04.1 server x86_64
Is there anything showing up in the shared device drop down (even if you can't select it?)
The drop-down activates, but is empty.
Also if you could attach ~/.virt-manager/virt-manager.log it might help.
This group popped up a lot yesterday:
[Tue, 19 Aug 2008 14:55:19 virt-manager 5811] WARNING (connection:494) Unable to list active networks [Tue, 19 Aug 2008 14:55:19 virt-manager 5811] WARNING (connection:498) Unable to list inactive networks [Tue, 19 Aug 2008 14:55:19 virt-manager 5811] ERROR (engine:158) Could not refresh connection qemu:///system <class 'libvirt.libvirtError'> virConnectListDomainsID() failed Broken pipe Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/engine.py", line 152, in _tick self.connections[uri]["connection"].tick() File "/usr/share/virt-manager/virtManager/connection.py", line 550, in tick newActiveIDs = self.vmm.listDomainsID() File "/usr/lib/python2.5/site-packages/libvirt.py", line 795, in listDomainsID if ret is None: raise libvirtError ('virConnectListDomainsID() failed', conn=self) libvirtError: virConnectListDomainsID() failed Broken pipe
This is probably from a libvirtd restart while virt-manager was running. If so, nothing to worry about.
Here's the output when I try to add a new network device:
[Wed, 20 Aug 2008 10:57:39 virt-manager 6673] ERROR (connection:158) Unable to connect to HAL to list network devices: '%s'<class 'dbus.exceptions.DBusException'> org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/connection.py", line 144, in detect_network_devices hal_object = self.bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager') File "/var/lib/python-support/python2.5/dbus/bus.py", line 244, in get_object follow_name_owner_changes=follow_name_owner_changes) File "/var/lib/python-support/python2.5/dbus/proxies.py", line 241, in __init__ self._named_service = conn.activate_name_owner(bus_name) File "/var/lib/python-support/python2.5/dbus/bus.py", line 183, in activate_name_owner self.start_service_by_name(bus_name) File "/var/lib/python-support/python2.5/dbus/bus.py", line 281, in start_service_by_name 'su', (bus_name, flags))) File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking message, timeout) DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files [Wed, 20 Aug 2008 10:57:47 virt-manager 6673] ERROR (console:106) Cannot initialize notification systemorg.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute dbus-launch to autolaunch D-Bus session
This is the problem: we use dbus to contact hal to list physical net devices on the system, then we probe their /sys path to determine if they are in a bridge, among other things. Make sure hald (or some equivalently named service) is running. Bar that, you'll probably have to ask the ubuntu folks. Thanks, Cole

James Bardin wrote:
Cole Robinson wrote:
Make sure hald (or some equivalently named service) is running. Bar that, you'll probably have to ask the ubuntu folks.
It's running. I'll see if I can figure out where this went wrong.
Does this apply to virsh as well?
Thanks -jim
No virsh/libvirt doesn't use hal. If you want to try manually adding the bridge device to the domain, try the following. 'virsh dumpxml vmname > tmpxml' edit 'tmpxml', add to the <devices> section: <interface type='bridge'> <source bridge='br0'/> </interface> 'virsh define tmpxml' Hope that helps, Cole
participants (4)
-
Charles Duffy
-
Cole Robinson
-
James Bardin
-
Richard W.M. Jones