Bug 237076

Summary: cannot set primary for bonded interfaces with new sysfs configuration
Product: Red Hat Enterprise Linux 5 Reporter: Bryn M. Reeves <bmr>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED DUPLICATE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-19 17:01:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
patch adding a PRIMARY parameter to ifup-eth none

Description Bryn M. Reeves 2007-04-19 11:01:30 UTC
Description of problem:
The bonding driver has moved to using sysfs to configure bonding properties.

In previous RHEL releases, it was possible to configure the primary interface
using a module option in /etc/modprobe.conf, e.g.:

options bond0 primary=eth0 mode=0 miimon=100

Initscripts now provides a BONDING_OPTS parameter to pass options to the module
but this no longer works as the interface has not been enslaved at the time the
option is processed:

bonding: bond0: Unable to set eth0 as primary slave as it is not a slave

This can be worked around by echoing the primary device into sysfs from rc.local
or another script:

echo "eth0" > /sys/class/net/bond0/bonding/primary

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

How reproducible:

Steps to Reproduce:
1. Configure a bonded interface with "primary=ethN" in BONDING_OPTS, where ethN
is one of the members of the bond
2. Start the interface via ifup
3. check dmesg
Actual results:
bonding: bond0: Unable to set eth0 as primary slave as it is not a slave

Expected results:
bond0 sets ethN as primary

Additional info:
It seems straightforward to add this as a parameter for bonded devices,
something like:

# Intel Corporation 82571EB Gigabit Ethernet Controller

# Intel Corporation 82571EB Gigabit Ethernet Controller

Comment 1 Bryn M. Reeves 2007-04-19 11:05:13 UTC
Created attachment 152990 [details]
patch adding a PRIMARY parameter to ifup-eth

This patch adds a PRIMARY parameter to ifup-eth. It's been tested and works OK;
I'm a bit unsure if there needs to be something to clear the primary on ifdown,
although the kernel seems to do the right thing anyway.

Comment 2 Bill Nottingham 2007-04-19 17:01:57 UTC

*** This bug has been marked as a duplicate of 236897 ***

Comment 3 Bryn M. Reeves 2007-04-19 17:09:04 UTC
Darn. I searched for this on Tuesday, and the guy who filed the other bug sits
next to me - sorry for the noise.