Bug 747924

Summary: virt-manager cannot enumerate the network interfaces connected to bridges
Product: [Community] Virtualization Tools Reporter: Shradha Shah <sshah>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, cwei, jwu, laine, mzhan, xen-maint, zpeng
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-31 18:07:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Shradha Shah 2011-10-21 12:13:16 UTC
Description of problem:
virt-manager polls for net devices using udev instead of hal_helper and hence cannot enumerate the network interfaces connected to bridges
In virt-manager/src/virtManager/connection.py

def _init_netdev(self):
        """
        Determine how we will be polling for net devices (HAL or libvirt)
        """
        if self.is_nodedev_capable() and self.interface_capable:
            try:
                self._build_libvirt_netdev_list()
                self.netdev_use_libvirt = True
            except Exception, e:
                self.netdev_error = _("Could not build physical interface "
                                      "list via libvirt: %s") % str(e)
        elif self.get_hal_helper():
            hal_helper = self.get_hal_helper()

            if self.is_remote():
                self.netdev_error = _("Libvirt version does not support "
                                      "physical interface listing")

self.is_nodedev_capable() and self.interface_capable evaluate to true.

If we change the code and force virt-manager to use hal-helper this bug is not seen.

Also if we build and install libvirt(./configure, make, make install), we do not see the bug as virt-manager uses hal-helper.

Version-Release number of selected component (if applicable):
0.8.6

How reproducible:
Always

Steps to Reproduce:
1)Create a Bridged networking setup using the eth0 interface following the
instructions here:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization/sect-Virtualization-Network_Configuration-Bridged_networking_with_libvirt.html

2) ifconfig -a shows the following devices:
br0       
eth0     
lo
virbr0
virbr0-nic
vnet0

3) Start virt-manager
4) Click on i -> Add Hardware -> Network
5) Click on the drop down list of Host devices
  
Actual results:

The following list of options in black and can be selected:
Host device vnet0 (Bridge 'br0')
Virtual network 'default': NAT
Specify shared device name

The following list of options in grey and cannot be selected:
Host device eth0 (Not bridged)
Host device lo (Not bridged)
Host device virbr0-nic (Not bridged)

Expected results:

The following list of options in black and can be selected:
Host device eth0(Bridge 'br0')
Host device vnet0 (Bridge 'br0')
Virtual network 'default': NAT
Specify shared device name

The following list of options in grey and cannot be selected:
Host device br0 (Not bridged)
Host device lo (Not bridged)

Additional info:

Comment 2 Shradha Shah 2011-10-21 12:42:57 UTC
The guest uses RHEL 5.6.

Comment 3 Shradha Shah 2011-10-21 15:30:11 UTC
After trying the same steps on rhel6.2 beta I realized the steps to reproduce should be as follows:

1)Create a Bridged networking setup using the eth0 interface following the
instructions here:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization/sect-Virtualization-Network_Configuration-Bridged_networking_with_libvirt.html

2) ifconfig -a shows the following devices:
br0       
eth0     
lo
virbr0
virbr0-nic
vnet0

3) Create a guest using virt-manager

4) If a virtual network interface is already plugged into the guest use virt-manager to remove it.

5) Restart virt-manager, Add a network interface corresponding to Host device eth0 (Bridge br0)

6) Restart guest and virt-manager

7) At this point the dropdown list of Host Devices in Add Hardware > Network does not show correct options as mentioned below
Also at this point the dropdown list of Host Devices in Add Hardware -> Network 
fails to show any other bridges if present on the host

Actual results:

The following list of options in black and can be selected:
Host device vnet0 (Bridge 'br0')
Virtual network 'default': NAT
Specify shared device name

The following list of options in grey and cannot be selected:
Host device eth0 (Not bridged)
Host device lo (Not bridged)
Host device virbr0-nic (Not bridged)

Expected results:

The following list of options in black and can be selected:
Host device eth0(Bridge 'br0')
Host device vnet0 (Bridge 'br0')
Virtual network 'default': NAT
Specify shared device name

The following list of options in grey and cannot be selected:
Host device br0 (Not bridged)
Host device lo (Not bridged)

Comment 4 zhe peng 2011-10-24 07:49:50 UTC
I can reproduce this on rhel6.2 with virt-manager-0.8.6-4.el6 ,but not with virt-manager-0.9.0-7.el6

now with 0.9.0-7 build(support macvtap),the results is:

The following list of options in black and can be selected:
Host device eth0(Bridge'br0')
Host device lo:macvtap
Host device virbr0-nic:macvtap
Host device vnet0:macvtap
Virtual network 'default':NAT
Specify shared device name

no options in grey and cannot be selected:

Comment 5 Laine Stump 2011-10-24 13:27:33 UTC
Actually, I would say that the vnet0 device should *not* be selectable, since that is created/used by libvirt. (Likewise, the "virbr0-nic" and similar devices shouldn't be selectable, and I would say shouldn't even be displayed at all. Those devices are just dummy devices created by libvirt to give the bridge a fixed MAC address, and are not usable for any kind of networking, and are never even set to "up" status.)

Comment 6 Cole Robinson 2011-10-25 13:22:39 UTC
At the very least, virt-manager queued for RHEL6.2 allows manually entering a bridge device name, so if the user wanted to use eth0 they could. So this can be deferred to 6.3

Comment 8 Cole Robinson 2012-01-29 22:00:12 UTC
Since it sounds like the original issue is fixed in latest RHEL, the remaining issue to track here is the pollution of the device list with entries like vnetX and virbr0-nic, etc.

Not urgent for RHEL, so moving to upstream tracker.

Comment 9 Cole Robinson 2013-08-31 18:07:41 UTC
The device list pollution is fixed upstream nowadays.