Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Came across a machine the other day that had a bonding file with TYPE=Ethernet and BONDING_OPTS="<valid stuff>" and BONDING_MASTER=yes. NM failed to bring up the bond because (legitimately) TYPE != Bond and printed a message to the journal.
However, the Fedora/RHEL scripts don't care about TYPE for bond masters, it seems. They:
1) call ifup-eth on the interface (because there is no 'ifup-bond')
2) calls source_config from network-functions, which sets DEVICETYPE=bond and REALDEVICE=bond0
3) calls is_available from network-functions, which sees BONDING_OPTS and then installs the bonding module, creating the bond0 device
4) then calls is_bonding_device from network-functions, which this device is (because it was created on modprobe in step #3)
5) proceeds to ifup each slave of the bond
so basically, the initscript don't care about TYPE for bonds, and in this specific case things work out because the interface is named bond0 and is created during the modprobe bonding process.
Maybe NM should just look for BONDING_OPTS or BONDING_MASTER and just assume TYPE=Bond if previously TYPE=Ethernet? I think this NM codepath has existed since 2011 when tgraf added bonding support in a2a0d788.
(In reply to Beniamino Galvani from comment #3)
> Created attachment 1265836[details]
> [PATCH] ifcfg-rh: also check BONDING_OPTS to determine the connection type
+ && svGetValueStr_cp (parsed, "BONDING_OPTS")
the "_cp" stands for copy. The patch leaks a string.
rest lgtm
It seems the steps from comment 1 only work because
1) the device is called bond0
2a) because the bonding module gets actually loaded and doesn't have
max_bonds=0
2b) or, for some other reason a bond with name bond0 already exists.
So, initscripts look at the current situation of interfaces and determines that this is a bond. I really wish that the settings plugin would make decisions based on the ifcfg-rh file alone, not looking at the system.... but that is already violated at other places and contradicts initscripts.
Anyway, checking for BONDING_OPTS seems like a safe bet still. So +1.
Comment 6Beniamino Galvani
2017-03-23 18:04:23 UTC
Created attachment 1265855[details]
[PATCH v2] ifcfg-rh: also check BONDING_OPTS to determine the connection type
(In reply to Thomas Haller from comment #4)
> the "_cp" stands for copy. The patch leaks a string.
Whoops, fixed in v2.
(In reply to Thomas Haller from comment #5)
> It seems the steps from comment 1 only work because
> 1) the device is called bond0
> 2a) because the bonding module gets actually loaded and doesn't have
> max_bonds=0
> 2b) or, for some other reason a bond with name bond0 already exists.
>
> So, initscripts look at the current situation of interfaces and determines
> that this is a bond. I really wish that the settings plugin would make
> decisions based on the ifcfg-rh file alone, not looking at the system....
> but that is already violated at other places and contradicts initscripts.
The configuration file in comment 0 works for every device name and
not only for bond0, because install_bonding_drivers(), which is called
when BONDING_OPTS is set, also creates the bond interface through
sysfs:
[ -n "$BONDING_OPTS" ] && install_bonding_driver $1
--
install_bonding_driver ()
{
[ ! -f /sys/class/net/bonding_masters ] && ( modprobe bonding || return 1 )
if ! fgrep -sqx "$1" /sys/class/net/bonding_masters; then
echo "+$1" > /sys/class/net/bonding_masters 2>/dev/null
...
So, it doesn't depend on system status.
Comment 7Beniamino Galvani
2017-03-29 07:59:57 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/RHSA-2017:2299