Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#43803 - [netctl] bonding does not work without modifications

Attached to Project: Arch Linux
Opened by Dale Blount (dale) - Thursday, 12 February 2015, 21:51 GMT
Last edited by Jouke Witteveen (jouke) - Tuesday, 16 June 2015, 21:04 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Description:
Netctl with bonding does not let the interface come up without modifications to /usr/lib/network/connections/bond

Additional info:
netctl 1.10-1

I had to comment out the "return 1" on line 11 of /usr/lib/network/connections/bond to get the bonding connection to come up.

I don't have the cut-and-paste errors as I was doing this over an iDrac (VNC-like) connection, but probably can get them if they are needed.

This task depends upon

Closed by  Jouke Witteveen (jouke)
Tuesday, 16 June 2015, 21:04 GMT
Reason for closing:  Upstream
Additional comments about closing:  Nothing meaningful we can do...
Comment by Dale Blount (dale) - Friday, 13 February 2015, 16:43 GMT
I'm also having problems with it coming up on boot, but I haven't been able to really fix those yet.

netctl restart bond0 is enough to bring it back after the system boots, unfortunately it needs to be done from console as the network is down until that comes up.

Says only: "Failed to start Bond Interface" under systemctl status netctl@bond0.service




Comment by Martin Gignac (techstone) - Tuesday, 24 March 2015, 15:43 GMT
I encountered an issue with bonding today and I think it might be related. I've noticed that on boot the created bond0 interface always uses mode 'balance-rr' irrespective of what the "Mode" parameter is set to in the profile. If one issues 'netctl restart bonding' however the mode is then correctly set on the bond0 interface.

I think this stems from the fact that the first time the 'ip link add name bond0 type bond mode <X>' command is called after boot (whether manually or in '/usr/lib/network/connections/bond' by systemd) the "bonding" module is autoloaded and defaults to mode 'balance-rr', disregarding any value provided to the 'mode' parameter (the error "RTNETLINK answers: File exists" is visible if the command is run on the command line). If one deletes the bond0 interface and then re-creates it with the same 'ip link' command this time the mode is set properly since the module is not loaded a second time and therefore doesn't override the 'mode' argument.

Modiyfing the bond script to reproduce the same behavior also works around the issue:

--- /usr/lib/network/connections/bond.orig 2015-01-13 08:23:37.000000000 -0500
+++ /usr/lib/network/connections/bond 2015-03-24 10:48:15.349914410 -0400
@@ -11,6 +11,8 @@
return 1
fi

+ interface_add bond "$Interface" "" # "dummy" interface_add to load bonding module
+ interface_delete "$Interface" # delete interface to re-add with proper mode below
interface_add bond "$Interface" "" ${Mode:+mode "$Mode"}
bring_interface_up "$Interface"
for slave in "${BindsToInterfaces[@]}"; do

-Martin
Comment by Jouke Witteveen (jouke) - Sunday, 14 June 2015, 12:45 GMT
For bonding connections, netctl wants to 'own' the interface. What you are trying to do is against that logic.
Comment by Martin Gignac (techstone) - Tuesday, 16 June 2015, 01:44 GMT
> For bonding connections, netctl wants to 'own' the interface. What you are trying to do is against that logic.

For my personal case all I wanted to achieve was allow netctl to successfully bring up a bond upon boot up that uses mode other than balance-rr. Is this what is against the logic of netctl 'owning' the interface?
Comment by Jouke Witteveen (jouke) - Tuesday, 16 June 2015, 06:57 GMT
Removing the "return 1" on line 11 of connections/bond is against that logic. Using modes other than balance-rr is, of course, not. Please provide a profile and instructions for the replication of the problem.
Comment by Jouke Witteveen (jouke) - Tuesday, 16 June 2015, 09:53 GMT
Sorry, didn't realize dale != techstone. My comments were directed to Dale.
@Martin: thanks for researching. Could it be that this is a bug in the way `ip` loads the bonding module?
Comment by Martin Gignac (techstone) - Tuesday, 16 June 2015, 13:55 GMT
@jouke: I did some more research and I think this is the normal bonding module behavior. There is a bonding module parameter called "max_bonds" which "Specifies the number of bonding devices to create for this instance of the bonding driver. [...] The default value is 1." So when the bonding module is (auto)loaded it automatically creates a "bond0" interface, which conflicts with a netctl profile or an "ip link" command which attempts to do the same right after!

I see two possibilities here: one can either elect to create netctl profiles with bonding interface names *other* than "bond0" (which results in the autocreated bond0 interface being "useless", or create a "/etc/modprobe.conf/bonding.conf" file with:

options bonding max_bonds=0

so that no bonding interfaces are created automatically upon module loading.
Comment by Jouke Witteveen (jouke) - Tuesday, 16 June 2015, 14:00 GMT
The last option sounds reasonable, but I think there might still be a bug here. Am I correct in assuming that ip, as called by netctl, is responsible for the loading of the bonding module? If so, then, since ip is given the mode, I would consider the current behavior a bug in ip.
Comment by Martin Gignac (techstone) - Tuesday, 16 June 2015, 14:31 GMT
<erased>
Comment by Martin Gignac (techstone) - Tuesday, 16 June 2015, 14:35 GMT
I'm completely out of my depth here, but I assume that the 'ip' utility makes some kind of call to the kernel, which then autoloads the bonding module. I could see the 'ip' maintainers countering that they have no way of knowing beforehand whether or not the bonding module will have been configured to autocreate bond0 or not when loaded.
Comment by Jouke Witteveen (jouke) - Tuesday, 16 June 2015, 15:47 GMT
Than that is where it stands, unfortunately.
Maybe this one gets fixed upstream, some day. Otherwise it is one for netctl 2, which would interface the systemd state machine more directly, but will possibly never materialize as systemd (networkd) is not too CLI-friendly.
Comment by Martin Gignac (techstone) - Tuesday, 16 June 2015, 16:31 GMT
> Than that is where it stands, unfortunately.

I concur. I don't see how netctl can work around this anymore than 'ip' can.

Loading...