Bug 1348198 - [RFE] cannot easily change active_slave
Summary: [RFE] cannot easily change active_slave
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Beniamino Galvani
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1299103 1393481 1428420
TreeView+ depends on / blocked
 
Reported: 2016-06-20 12:23 UTC by Vladimir Benes
Modified: 2017-08-01 09:17 UTC (History)
7 users (show)

Fixed In Version: NetworkManager-1.8.0-0.4.rc1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1428420 (view as bug list)
Environment:
Last Closed: 2017-08-01 09:17:07 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:2299 normal SHIPPED_LIVE Moderate: NetworkManager and libnl3 security, bug fix and enhancement update 2017-08-01 12:40:28 UTC

Description Vladimir Benes 2016-06-20 12:23:22 UTC
Description of problem:
when I add a bond with two slaves and add active slave option I cannot switch it more than one time.

[root@wlan-r2s5 NetworkManager]# nmcli connection add type bond 
Connection 'bond' (f57d0507-99f3-4e2d-91c6-9b1bcf4571c5) successfully added.
[root@wlan-r2s5 NetworkManager]# nmcli connection add type ethernet ifname eth1 master nm-bond 
Connection 'ethernet-eth1' (68ec93c1-d2dd-4581-bff7-fd21e957c0c1) successfully added.
[root@wlan-r2s5 NetworkManager]# nmcli connection add type ethernet ifname eth2 master nm-bond 
Connection 'ethernet-eth2' (356e1d0b-bc1e-4c00-aa8d-658d08675a95) successfully added.

[root@wlan-r2s5 NetworkManager]# nmcli connection modify bond connection.autoconnect-slaves 1 bond.options "mode=active-backup,active_slave=eth2"

[root@wlan-r2s5 NetworkManager]# cat /proc/net/bonding/nm-bond 
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1


[root@wlan-r2s5 NetworkManager]# nmcli connection up id bond 
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/9)
[root@wlan-r2s5 NetworkManager]# cat /proc/net/bonding/nm-bond 
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
    ^^^^ this is OK

MII Status: up

[root@wlan-r2s5 NetworkManager]# nmcli connection modify bond connection.autoconnect-slaves 1 bond.options "mode=active-backup,active_slave=eth1"
[root@wlan-r2s5 NetworkManager]# nmcli connection up id bond 
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/12)
[root@wlan-r2s5 NetworkManager]# cat /proc/net/bonding/nm-bond 
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
    ^^^^ so far so good

so I changed it back to eth2 again and this doesn't work anymore
[root@wlan-r2s5 NetworkManager]# nmcli connection modify bond connection.autoconnect-slaves 1 bond.options "mode=active-backup,active_slave=eth2"
[root@wlan-r2s5 NetworkManager]# nmcli connection up id bond 
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/15)
[root@wlan-r2s5 NetworkManager]# cat /proc/net/bonding/nm-bond 
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
                 ^^^^^^^^^^^^^^ this is wrong


[root@wlan-r2s5 NetworkManager]# cat /etc/sysconfig/network-scripts/ifcfg-bond 
DEVICE=nm-bond
TYPE=Bond
BONDING_MASTER=yes
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=bond
UUID=f57d0507-99f3-4e2d-91c6-9b1bcf4571c5
ONBOOT=yes
BONDING_OPTS="mode=active-backup active_slave=eth2"
                           ^^^^ this seems to be correct

some device disconnect of whole setup may help sometimes but this doesn't work everytime

when I disconnect everything and connect bond master with slaves together I get 
Currently Active Slave: eth1
even if:
BONDING_OPTS="mode=active-backup active_slave=eth2"

I can of course juggle with slaves but I think NM should respect that option and that connection should be set as currently active slave
 
Version-Release number of selected component (if applicable):
NetworkManager-1.4.0-0.1.git20160606.b769b4df.el7.x86_64

Comment 1 Thomas Haller 2016-06-20 12:38:34 UTC
I wonder if the "active_slave" setting in a connection make sense.

To me a ~connection~ is some a static description of configuration, while the active-slave is a setting that matters to a device (at runtime, so to say).



We already have ways to set properties on the device:

  nmcli device modify $IFACE <autoconnect|managed> 

maybe

  nmcli device modify $IFACE active-slave $SLAVE

would be a good fit.

Comment 2 Vladimir Benes 2016-06-20 13:45:06 UTC
(In reply to Thomas Haller from comment #1)
> I wonder if the "active_slave" setting in a connection make sense.
> 
> To me a ~connection~ is some a static description of configuration, while
> the active-slave is a setting that matters to a device (at runtime, so to
> say).
>
this is now valid option of BONDING_OPTS (not sure if it was ever supported by network script) so it's quite wrong if it's set when bond is created and then upped and there is something else in /sys/class/net/nm-bond/bonding/active_slave
 
> 
> 
> We already have ways to set properties on the device:
> 
>   nmcli device modify $IFACE <autoconnect|managed> 
> 
> maybe
> 
>   nmcli device modify $IFACE active-slave $SLAVE
> 
> would be a good fit.

yeah, maybe it may be nice to have these modifications here just valid at runtime.

Comment 3 Thomas Haller 2016-07-03 20:46:27 UTC
would be nice to do this via:

  nmcli device modify bond0 bond.active_slave eth0



the problem is, that nmcli treads bond options in an clumsy way, where there is only one "bond.options" property. So, in the current scheme, above command would look like

  nmcli device modify bond0 +bond.options "active_slave=eth0"

which is pretty bad.

Comment 4 Beniamino Galvani 2017-03-03 13:06:33 UTC
I would prefer to avoid adding other device properties for each bond options that can be changed at runtime. In my opinion the reapply facility is the way to go, even if the syntax might not be the easiest one for bonds.

Pushed branch bg/bond-reapply-rh1348198 for review.

Comment 5 Thomas Haller 2017-03-04 10:28:27 UTC
Branch looks good to me as is

Comment 6 Thomas Haller 2017-03-04 15:11:44 UTC
(In reply to Beniamino Galvani from comment #4)
> I would prefer to avoid adding other device properties for each bond options
> that can be changed at runtime. In my opinion the reapply facility is the
> way to go, even if the syntax might not be the easiest one for bonds.

I fully agree with this.

And I think our reapply mechanism and the settings-connection/applied-connection split is pretty awesome with lots of potential uses (like this feature).

Comment 9 errata-xmlrpc 2017-08-01 09:17:07 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


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