Bug 1490157

Summary: message "VLAN devices can not be created without a parent interface" when using vlans ontop of teaming interfaces
Product: Red Hat Enterprise Linux 7 Reporter: Christian Horn <chorn>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: atragler, bgalvani, chorn, fgiudici, lrintel, rkhan, sukulkar, thaller, vbenes
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 13:29:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1420851, 1522983    
Attachments:
Description Flags
rhel7.3_NM-trace_messages after reboot none

Description Christian Horn 2017-09-11 01:28:02 UTC
Description of problem:
message "VLAN devices can not be created without a parent interface" when using vlans ontop of teaming interfaces

Version-Release number of selected component (if applicable):
NetworkManager-1.8.0-9.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. install a rhel7 system, i.e. 7.4, can be a KVM guest.
   Ensure multiple interfaces are available, for example eth[012]
2. After installation setup the teaming-interface and vlan as follows:
$ nmcli con add type team con-name Team1 ifname Team1 \
    config '{ "runner": {"name": "activebackup"} }'
$ nmcli con add type ethernet con-name Team1-slave1 ifname eth1 master Team1
$ nmcli con add type ethernet con-name Team1-slave2 ifname eth2 master Team
$ nmcli con mod Team1 ipv4.method disabled
$ nmcli con up Team1-slave1
$ nmcli con up Team1-slave2
$ nmcli con up Team1
$ nmcli con add type vlan con-name myvlan23 ifname myvlan23 dev Team1 id 23
$ nmcli con mod myvlan23 ipv4.address 192.168.0.1/24
$ nmcli con mod myvlan23 ipv4.method manual
$ nmcli con up myvlan23
$ ping 192.168.0.1 # or ping from a different system with vlan-id23 tagges
                   # packets
$ reboot

Actual results:
After reboot, these messages appear:
# grep 'VLAN devices can not be created without a parent interface' messages 
Sep  7 08:28:51 rhel7u3a NetworkManager[471]: <warn>  [1504765731.2620] manager: (myvlan23) couldn't create the device: VLAN devices can not be created without a parent interface

Expected results:
No messages should appear

Additional info:

Comment 3 Christian Horn 2017-09-11 03:23:21 UTC
The customer has seen this:

Aug 23 03:22:31 host NetworkManager[1132]: <info>  [1503426151.7481] manager: (team0): new Team device (/org/freedesktop/NetworkManager/Devices/13)
Aug 23 03:22:31 host NetworkManager[1132]: <info>  [1503426151.7489] manager: (team0.3663): new VLAN device (/org/freedesktop/NetworkManager/Devices/14)
Aug 23 03:22:31 host NetworkManager[1132]: <warn>  [1503426151.7491] manager: (team0.3663) couldn't create the device: no support for VLANs on interface team0 of type Team
Aug 23 03:22:31 host NetworkManager[1132]: <info>  [1503426151.7532] manager: (team0.3663): new VLAN device (/org/freedesktop/NetworkManager/Devices/15)
Aug 23 03:22:31 host kernel: 8021q: 802.1Q VLAN Support v1.8
Aug 23 03:22:31 host kernel: 8021q: adding VLAN 0 to HW filter on device ens3f0
Aug 23 03:22:31 host kernel: 8021q: adding VLAN 0 to HW filter on device ens3f1
Aug 23 03:22:31 host kernel: 8021q: adding VLAN 0 to HW filter on device ens6f0

The order seems to suggest that the VLAN interface is attempted
to be taken up while the module is not yet loaded, but on a system
here with just eth/vlan interface, the order is the same:

Sep  7 10:47:57 rhel7u4a NetworkManager[506]: <info>  [1504774077.8741] ifcfg-rh: add connection /etc/sysconfig/network-scripts/ifcfg-myvlan23 (4985f2f8-f4dc-4eda-86a2-f64a0a917371,"myvlan23")
Sep  7 10:47:57 rhel7u4a NetworkManager[506]: <info>  [1504774077.8758] manager: (myvlan23): new VLAN device (/org/freedesktop/NetworkManager/Devices/4)
Sep  7 10:47:57 rhel7u4a kernel: 8021q: 802.1Q VLAN Support v1.8
Sep  7 10:47:57 rhel7u4a kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Sep  7 10:47:57 rhel7u4a kernel: 8021q: adding VLAN 0 to HW filter on device eth1

Interesting that in my reproducer the used-counter for the 8021q module 
is "0" when the vlan-interface is already up, but that is nothing in
the NM area.

Is NM here not paying attention to the dependencies of interfaces?

The endcustomer would, if the message is harmless, be happy with
having the message extended to "no support for VLANs on interface 
team0 of type Team yet".

From GSS perspective, this should not be a message on level "warning".

Comment 4 Christian Horn 2017-09-11 06:45:23 UTC
Reworked reproducer commands, "type ethernet" was incorrect.  The message occurs as before:

nmcli con add type team con-name con-team0 ifname team0 \
    config '{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}'
nmcli connection modify con-team0 ipv4.method disable ipv6.method ignore
nmcli connection up con-team0
nmcli con add type team-slave con-name team0-slave1 ifname eth1 master team0
nmcli con add type team-slave con-name team0-slave2 ifname eth2 master team0
nmcli con add type vlan con-name team0-vlan23 ifname team0.23 id 23 \
    dev team0 ip4 192.168.0.1/24
nmcli con up team0-vlan23
ping 192.168.0.1 # just ensuring the ip is available as expected.
                 # ing from a different system with vlan-id23 tagged
                 # packets.
reboot
# grep -A8 -B5 warn messages 
Sep 11 06:41:40 rhel7u4a NetworkManager[486]: <info>  [1505104900.3923] device (eth2): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Sep 11 06:41:40 rhel7u4a NetworkManager[486]: <info>  [1505104900.3940] device (eth2): link connected
Sep 11 06:41:40 rhel7u4a kernel: IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
Sep 11 06:41:40 rhel7u4a NetworkManager[486]: <info>  [1505104900.3982] manager: (team0): new Team device (/org/freedesktop/NetworkManager/Devices/5)
Sep 11 06:41:40 rhel7u4a NetworkManager[486]: <info>  [1505104900.3995] manager: (team0.23): new VLAN device (/org/freedesktop/NetworkManager/Devices/6)
Sep 11 06:41:40 rhel7u4a NetworkManager[486]: <warn>  [1505104900.3998] manager: (team0-vlan23) couldn't create the device: no support for VLANs on interface team0 of type Team
Sep 11 06:41:40 rhel7u4a NetworkManager[486]: <info>  [1505104900.4118] manager: (team0.23): new VLAN device (/org/freedesktop/NetworkManager/Devices/7)
Sep 11 06:41:40 rhel7u4a kernel: 8021q: 802.1Q VLAN Support v1.8
Sep 11 06:41:40 rhel7u4a kernel: 8021q: adding VLAN 0 to HW filter on device eth0
Sep 11 06:41:40 rhel7u4a kernel: 8021q: adding VLAN 0 to HW filter on device eth1
Sep 11 06:41:40 rhel7u4a kernel: 8021q: adding VLAN 0 to HW filter on device eth2
Sep 11 06:41:40 rhel7u4a NetworkManager[486]: <info>  [1505104900.4515] device (team0): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Sep 11 06:41:40 rhel7u4a kernel: IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready
Sep 11 06:41:40 rhel7u4a kernel: IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready

Comment 5 Thomas Haller 2017-09-11 07:15:09 UTC
This BZ is only about a log message that is too alarming?

Could you please attach the full logfile (with enabing level=TRACE logging before rebooting, see hints at https://cgit.freedesktop.org/NetworkManager/NetworkManager/plain/contrib/fedora/rpm/NetworkManager.conf?id=master about private data)

Comment 6 Christian Horn 2017-09-11 08:00:45 UTC
Created attachment 1324365 [details]
rhel7.3_NM-trace_messages after reboot

Comment 7 Christian Horn 2017-09-11 08:06:43 UTC
(In reply to Thomas Haller from comment #5)
> This BZ is only about a log message that is too alarming?
This bz is also to find out whether there is something wrong or not.  If running Mission Critical systems, then one is worried about Warnings logged for such default configurations..

If this is a warning which can be ignored, please let us know.  In that case, we should consider to phrase this better - but that can happen with lower priority than if there is an issue with the teaming/vlan combination.

Comment 8 Beniamino Galvani 2017-09-14 09:04:46 UTC
(In reply to Christian Horn from comment #7)
> (In reply to Thomas Haller from comment #5)
> > This BZ is only about a log message that is too alarming?
> This bz is also to find out whether there is something wrong or not.  If
> running Mission Critical systems, then one is worried about Warnings logged
> for such default configurations..

There is nothing wrong in the log file. Those messages shouldn't
really be warnings, and they should be degraded to a less severe
level. In particular, the message:

 manager: (team0-vlan23) couldn't create the device: no support for VLANs on interface team0 of type Team

is printed when NM checks whether team0.23 can be created and it
detects that the interface depends on team0 which doesn't exist
yet. Messages like these are useful only when debugging the dependency
tracking done by NM.

> If this is a warning which can be ignored, please let us know.  In that
> case, we should consider to phrase this better - but that can happen with
> lower priority than if there is an issue with the teaming/vlan combination.

Yes, I confirm that the warning can be safely ignored. I have prepared
some patches to downgrade those messages from 'warning' to 'debug'
level.

Comment 9 Beniamino Galvani 2017-09-14 09:05:40 UTC
Pushed branch bg/manager-parent-warnings-rh1490157 for review.

Comment 10 Christian Horn 2017-09-15 00:14:18 UTC
Thanks a bunch!

Comment 11 Thomas Haller 2017-09-18 13:15:37 UTC
(In reply to Beniamino Galvani from comment #9)
> Pushed branch bg/manager-parent-warnings-rh1490157 for review.

+ error->code == NM_DEVICE_ERROR_MISSING_DEPENDENCIES

error codes only make sense within the right domain. For correctness, we should use

 g_error_matches(error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_MISSING_DEPENDENCIES)



Rest lgtm

Comment 12 Beniamino Galvani 2017-09-20 06:16:08 UTC
(In reply to Thomas Haller from comment #11)
> (In reply to Beniamino Galvani from comment #9)
> > Pushed branch bg/manager-parent-warnings-rh1490157 for review.
> 
> + error->code == NM_DEVICE_ERROR_MISSING_DEPENDENCIES
> 
> error codes only make sense within the right domain. For correctness, we
> should use
> 
>  g_error_matches(error, NM_DEVICE_ERROR,
> NM_DEVICE_ERROR_MISSING_DEPENDENCIES)

Fixed and merged:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=05618aaaf388c03f9eea31b6a42f666868988c51

Comment 13 Christian Horn 2017-09-20 10:45:21 UTC
Could we get pm_ack and qa_ack on this one?
I think the issue is also good reproducable (considering the efforts required to QA the fix).

Comment 17 errata-xmlrpc 2018-04-10 13:29:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0778