RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 613886 - virsh iface command can not list interface correctly.
Summary: virsh iface command can not list interface correctly.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: netcf
Version: 6.0
Hardware: All
OS: Linux
low
high
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 618618 623731 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-13 05:58 UTC by Johnny Liu
Modified: 2011-12-07 22:21 UTC (History)
16 users (show)

Fixed In Version: netcf-0.1.6-4.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 21:13:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
affects on adding new network interface on host (221.07 KB, image/png)
2010-07-15 07:10 UTC, weizhang
no flags Details

Description Johnny Liu 2010-07-13 05:58:51 UTC
Description of problem:
Install RHEL6 beta2 os by default, virsh iface command can not list interface correctly.
# virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
lo                   active     00:00:00:00:00:00
"eth0"               inactive   


Version-Release number of selected component (if applicable):
NetworkManager-0.8.1-2.el6.x86_64
kernel-2.6.32-44.el6.x86_64
libvirt-0.8.1-13.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install rhel6 beta2 os (RHEL6.0-20100707.4) on host.
2. Issue virsh iface command to list host interface.
# virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
lo                   active     00:00:00:00:00:00
"eth0"               inactive   

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:25:64:A6:FB:CC  
          inet addr:10.66.92.185  Bcast:10.66.93.255  Mask:255.255.254.0
          inet6 addr: 3ffe:501:ffff:100:225:64ff:fea6:fbcc/64 Scope:Global
          inet6 addr: fe80::225:64ff:fea6:fbcc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11196 errors:0 dropped:0 overruns:0 frame:0
          TX packets:277 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1785925 (1.7 MiB)  TX bytes:36389 (35.5 KiB)
          Memory:febe0000-fec00000

# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:25:64:A6:FB:CC"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
  
Actual results:
virsh iface list --all will display eth0 with double quotation, and the eth0 interface's status is not correct.

Expected results:
virsh iface list --all should display host interface name and status correctly.

Additional info:
After I remove the double quotation in /etc/sysconfig/network-scripts/ifcfg-eth0, the virsh iface command works fine.

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:25:64:A6:FB:CC
IPV6INIT=yes
IPV6_AUTOCONF=yes
NM_CONTROLLED=yes
ONBOOT=yes

# virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
eth0                 active     00:25:64:a6:fb:cc
lo                   active     00:00:00:00:00:00

I guest maybe the issue is caused by inconsistency between virsh iface and NetworkManager.

Comment 3 Daniel Berrangé 2010-07-13 09:40:13 UTC
This looks like a pretty basic parser error in netcf. Including quotes is certainly allowed & needs to be taken into account.

Comment 4 Laine Stump 2010-07-13 15:17:31 UTC
Yeah this is something that somebody just started doing recently, which is why it hasn't popped up before now. (I actually saw it once about a week ago for the first time, but assumed at the time that it was something I'd messed up, not that it came that way out of the box).

David - is this something that has to be handled in Augeas, or at a higher level?

Comment 5 Laine Stump 2010-07-14 23:33:24 UTC
Dan - do you know what code has changed that's started putting quotes around all the values in the ifcfg-* files? (who makes the original ifcfg files? anaconda?)

I have no problem supporting the reading of these files, but am loathe to start quoting when writing *to* the files without knowing why they're showing up this way now.

(In particular, if they're just stripped off when augeas reads them in, during the write there would be no information about whether or not to quote (what about newly defined values?) and I don't want to start quoting everything in ifcfg-* files on older systems; who knows what other tools / scripts that might screw up... I notice that NetworkManager unquotes everything as it writes it, unless there's a space in the value, which makes sense to me)

Comment 6 weizhang 2010-07-15 07:10:59 UTC
Created attachment 431984 [details]
affects on adding new network interface on host

Comment 7 weizhang 2010-07-15 07:14:01 UTC
It affects the virt-manager on adding new network interface on host.

Comment 8 Daniel Berrangé 2010-07-15 09:11:06 UTC
IMHO it isn't relevant what app is putting quotes, because an admin editing the files themselves is just as likely to add quotes. So we need to cope with this regardless. The ifcfg-XXX files are technically in "shell" syntax, hence quotes are required if the value contains whitespace or other shell meta characters, otherwise optional.

Comment 9 Laine Stump 2010-07-15 15:31:13 UTC
I both agree and disagree with you. I agree that netcf should be able to handle quoted values, but do think knowing who made the change is relevant - it's possible it was just a gratuitous change (likely) in which case it won't be a problem if netcf writes out modified lines with unquoted values, but it's also possible that someone made the change and now expects all the values to be quoted (very unlikely, but possible).

Comment 10 Laine Stump 2010-07-20 13:00:45 UTC
A fix has been committed upstream:

https://fedorahosted.org/pipermail/netcf-devel/2010-July/000431.html

I've tested this, and it does properly solve the problem. Now awaiting the necessary ACKs to put it into RHEL.

Comment 11 Laine Stump 2010-07-20 13:17:28 UTC
That fix is also now posted to rhvirt-patches:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2010-July/msg00580.html

Comment 12 Laine Stump 2010-07-20 13:52:02 UTC
netcf-0.1.6-3.el6, which contains the fix, has been built for RHEL-6, and will
be in the next compose.

Comment 13 weizhang 2010-07-21 08:22:36 UTC
After upgrade the netcf-0.1.6-3.el6 and restart the libvirtd service, there is an error occured when I try iface-list:

[root@dhcp-66-92-126 images]# virsh iface-list --all
error: Failed to list active interfaces
error: internal error failed to get number of interfaces on host (netcf: unspecified error - errors in loading some config files)

version of related components:
libvirt-0.8.1-15.el6.x86_64
netcf-0.1.6-3.el6.x86_64
kernel 2.6.32-50.el6.x86_64

Comment 14 Laine Stump 2010-07-21 13:36:15 UTC
Please attach the contents of the /etc/sysconfig/network-scripts/ifcfg-* files, as well as /etc/sysconfig/iptables.

Comment 15 weizhang 2010-07-22 02:39:35 UTC
Today after I reinstall the netcf-0.1.6-3.el6.x86_64, it appears another error:
[root@dhcp-66-92-126 Downloads]# virsh iface-list --all
error: Failed to list active interfaces
error: this function is not supported by the connection driver: virConnectNumOfInterfaces

version of related components:
libvirt-0.8.1-17.el6.x86_64
netcf-0.1.6-3.el6.x86_64
kernel 2.6.32-50.el6.x86_64 

#vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"

#vi /etc/sysconfig/iptables

# Generated by iptables-save v1.4.7 on Mon Jul 19 19:09:45 2010
*nat
:PREROUTING ACCEPT [3325:514584]
:POSTROUTING ACCEPT [291:29482]
:OUTPUT ACCEPT [325:33721]
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
COMMIT
# Completed on Mon Jul 19 19:09:45 2010
# Generated by iptables-save v1.4.7 on Mon Jul 19 19:09:45 2010
*filter
:INPUT ACCEPT [23:3309]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2:100]
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A FORWARD -m physdev --physdev-is-bridged -j ACCEPT
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
COMMIT
# Completed on Mon Jul 19 19:09:45 2010

Comment 16 weizhang 2010-07-22 06:04:02 UTC
Sorry, I forget to close the NetworkManager and after I close it, the error is the same as Comment 13.

Comment 17 Laine Stump 2010-07-22 07:13:41 UTC
David,

It's not liking the iptables file. Can you see what's wrong with it?

Comment 18 Laine Stump 2010-07-22 07:20:18 UTC
By the way, weizhang - I'm curious why you have set 

net.bridge.bridge-nf-call-iptables = 1

on this test machine. The default for RHEL6 is 0. If it is set to 0, netcf won't even need to read the iptables file at all, and will thus avoid this problem. (it still should be fixed, of course)

Comment 19 weizhang 2010-07-22 08:06:42 UTC
Laine Stump, I doesn't set 
net.bridge.bridge-nf-call-iptables = 1

# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

Comment 20 Laine Stump 2010-07-22 12:01:45 UTC
Very interesting! When I put your iptables file on my system and set net.bridge.bridge-nf-call-iptables = 1, netcf fails exactly as you say, but when I set net.bridge.bridge-nf-call-iptables = 0, it works with no problem (because it's not reading the iptables file).

Can I have access to the system to look around myself for other causes?

Thanks!

Comment 22 Laine Stump 2010-07-27 19:46:55 UTC
This error:

error: internal error failed to get number of interfaces on host (netcf:
unspecified error - errors in loading some config files)

was due to the 0.1.6-3 build requiring a new file, but not installing that file. This only affected RHEL builds, not upstream, because the RHEL specfile doesn't regenerate Makefile.in from Makefile.am.

A patch has been posted to the internal patch list.

Comment 23 Laine Stump 2010-07-27 19:59:20 UTC
*** Bug 618618 has been marked as a duplicate of this bug. ***

Comment 24 Laine Stump 2010-07-27 20:01:46 UTC
netcf-0.1.6-4.el6 has been built with the fix. It will be in RHEL 6.0 snapshot 9, and is also available here:

https://brewweb.devel.redhat.com/taskinfo?taskID=2630304

Comment 25 Laine Stump 2010-07-27 20:05:37 UTC
A better link to find the rpm's is one to the buildinfo:

https://brewweb.devel.redhat.com//buildinfo?buildID=138474

Comment 26 weizhang 2010-07-28 02:11:43 UTC
After upgrade the netcf to 0.1.6-4, I test it

#cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="B8:AC:6F:3B:0D:56"
NM_CONTROLLED="yes"
ONBOOT="yes"

#virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
eth0                 active     b8:ac:6f:3b:0d:56
lo                   active     00:00:00:00:00:00

# ifconfig
eth0      Link encap:Ethernet  HWaddr B8:AC:6F:3B:0D:56  
          inet addr:10.66.93.195  Bcast:10.66.93.255  Mask:255.255.254.0
          inet6 addr: 3ffe:501:ffff:100:baac:6fff:fe3b:d56/64 Scope:Global
          inet6 addr: fe80::baac:6fff:fe3b:d56/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1377806 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1368576 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1091153086 (1.0 GiB)  TX bytes:993362949 (947.3 MiB)
          Memory:fdfe0000-fe000000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:34289 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34289 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:72310869 (68.9 MiB)  TX bytes:72310869 (68.9 MiB)

I think there is no problem now

version info:
libvirt-0.8.1-18.el6.x86_64
netcf-libs-0.1.6-4.el6.x86_64
netcf-0.1.6-4.el6.x86_64
kernel 2.6.32-52.el6.x86_64

Comment 27 releng-rhel@redhat.com 2010-11-10 21:13:35 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Comment 28 Laine Stump 2010-12-01 16:58:00 UTC
*** Bug 623731 has been marked as a duplicate of this bug. ***

Comment 29 Paul Moore 2011-12-07 07:58:09 UTC
When the following syntax is placed in "/etc/sysconfig/network-scripts/ifcfg-eth0" the problem reappears.

DEVICE="eth0";                  # The physical device name. **COMPULSORY**
HWADDR="20:CF:30:04:B9:61";     # The mac address used to recognise hardware.
ONBOOT="yes";                   # Initialise this device on system start-up.
BRIDGE="br0";                   # This DEVICE is part of this BRIDGE.

When the following syntax is placed in "/etc/sysconfig/network-scripts/ifcfg-eth0" the problem reappears.

DEVICE="eth0";
HWADDR="20:CF:30:04:B9:61";
ONBOOT="yes";
BRIDGE="br0";

but when the following syntax is used instead, there is no problem.

DEVICE="eth0"
                                # The physical device name. **COMPULSORY**
HWADDR="20:CF:30:04:B9:61"
                                # The mac address used to recognise hardware.
ONBOOT="yes"
                                # Initialise this device on system start-up.
BRIDGE="br0"
                                # This DEVICE is part of this BRIDGE.

My guess would be that the netcf libraries do not like a semi-colon at the end of a line. The above syntax works fine with the initscripts package.


rpm -q netcf netcf-libs
    netcf-0.1.9-2.el6.x86_64
    netcf-libs-0.1.9-2.el6.x86_64


As per the comments above, netcf should accept valid shell characters in the network-scripts/ifcfg files.

Comment 30 Daniel Berrangé 2011-12-07 09:40:28 UTC
@pmoore: this bug is now closed because an errata has been issued. Due to the way bug / release process works, this will not be re-opened, so please file a new bug for the problems you describe in comment #29

Comment 31 Paul Moore 2011-12-07 22:21:56 UTC
I have opened a new bug https://bugzilla.redhat.com/show_bug.cgi?id=761246 for this.


Note You need to log in before you can comment on or make changes to this bug.