Bug 1817948

Summary: [RHVH-4.4] Create bond via cockpit, the default mode is not consistent with the mode in the created bond
Product: Red Hat Enterprise Linux 8 Reporter: peyu
Component: cockpitAssignee: Marius Vollmer <mvollmer>
Status: CLOSED ERRATA QA Contact: Jan Ščotka <jscotka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.2CC: cshao, lsvaty, mavital, mpitt, nlevy, peyu, qiyuan, sbonazzo, shlei, weiwang, yaniwang, yturgema
Target Milestone: rc   
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:53:29 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: Create bond via cockpit, the default mode is not consistent with the mode in ifcfg-bond
Embargoed:

Description peyu 2020-03-27 09:56:43 UTC
Description of problem:
When creating bond via cockpit, in the "Bond Settings" page, the default value for "Mode" drop-down list is "Active backup". If keep this default value, in the generated bond, the bond mode is "Round Robin".

Version-Release number of selected component (if applicable):
cockpit-system-211.3-1.el8.noarch
cockpit-ws-211.3-1.el8.x86_64
cockpit-ovirt-dashboard-0.14.3-1.el8ev.noarch
cockpit-211.3-1.el8.x86_64
cockpit-bridge-211.3-1.el8.x86_64
cockpit-dashboard-211.3-1.el8.noarch
cockpit-storaged-211.3-1.el8.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install "redhat-virtualization-host-4.4.0-20200325.0.el8_2"
2. Login to cockpit
3. Click "Networking" -> "Add Bond", in the "Bond Settings" page, select 2 NICs from the "Interfaces" check-box
4. Keep the default value of "Mode" as "Active backup", click the "Apply" button
5. Enter "Networking" -> "bond0" page, focus on the value of the "Bond" item in bond0
6. Login RHVH, check the configuration file "ifcfg-bond0"
   # cat /etc/sysconfig/network-scripts/ifcfg-bond0


Actual results:
In the "Networking" -> "bond0" page, the value of "Bond" is "Round Robin" and in the generated "ifcfg-bond0" file, the mode is "balance-rr"
~~~
BONDING_OPTS="downdelay=0 miimon=100 mode=balance-rr updelay=0"
TYPE=Bond
BONDING_MASTER=yes
PROXY_METHOD=none
BROWSER_ONLY=no
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=bond0
UUID=a42cb335-2b3b-4c7c-8212-421f2000dbc4
DEVICE=bond0
ONBOOT=yes
AUTOCONNECT_SLAVES=yes
~~~

Expected results:
In the "Bond Settings" page, if the default value of "Mode" is "Active backup", the "Primary" drop-down list should be visible by default and the created bond mode should be "Active backup"

Additional info:
In the "Bond Settings" page, from the "Mode" drop-down list, if select an other mode before clicking the "Active Backup" mode, then click the "Active backup" mode, the result will be correct.

Comment 1 Martin Pitt 2020-04-07 09:21:34 UTC
Marius, can you please have a look at this?

Comment 2 Marius Vollmer 2020-04-07 12:19:06 UTC
Confirmed, this happens also with master on Fedora 31.

Comment 3 Marius Vollmer 2020-04-07 12:45:39 UTC
Fix here: https://github.com/cockpit-project/cockpit/pull/13866

Thus, this is a problem with our UI logic.  Programmatically selecting from a drop down menu did change how it looks, but didn't actually change the value of the drop down that the program sees.  Changes to a drop down by the user work as expected.

As a workaround, you can explicitly switch to "Round Robin" (or any other choice) and then back to "Active Backup".  Then the UI logic will correctly create a bond with mode Active Backup.

Comment 10 errata-xmlrpc 2020-11-04 01:53:29 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 (cockpit bug fix and enhancement update), 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-2020:4511