Bug 36341

Summary: bond-primary is never written to UCR
Product: UCS Reporter: Janis Meybohm <meybohm>
Component: UMC - Basic settingsAssignee: Florian Best <best>
Status: CLOSED FIXED QA Contact: Philipp Hahn <hahn>
Severity: normal    
Priority: P5 CC: gohmann, grandjean, hahn, jmm, stephan.hendl
Version: UCS 3.2Flags: hahn: Patch_Available+
Target Milestone: UCS 3.2-4-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: --- What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:
Bug Depends on:    
Bug Blocks: 36342    
Attachments: Fix bond-primary UCR variable

Description Janis Meybohm univentionstaff 2014-10-29 16:32:53 CET
2014102821000257

The selected primary interface in the bonding wizard is never written into UCR.

This is problematic in scenarios where one of the network paths is prefered (faster for example). In case of failure, the bond switches to the (slower) fallback interface/path but never switches back to the prefered (primary) interface/path when that one is back up.


Workaround:
Configure manually via UCR:
  ucr set interfaces/bond1/options/X="bond-primary ethN"

Don't know if that gets overridden when re-running the UMC wizard.


Manuel switch to the prefered interface is also possible at runtime via ifenslave, e.g.:
# ifenslave -c bond0 eth0
Comment 1 Philipp Hahn univentionstaff 2014-10-30 13:10:25 CET
"1" != 1 in the requests to http:///umcp/command/setup/validate and http:///umcp/command/setup/save:
{
   "options" : {
      "values" : {
         "interfaces" : {
            "bond0" : {
...
               "bond_mode" : "1",
            },
            "eth1" : {...},
            "eth0" : {...}
         }
      }
   }
}

diff --git a/branches/ucs-3.2/ucs-3.2-3/base/univention-system-setup/umc/python/setup/network.py b/branches/ucs-3.2/ucs-3.2-3/base/univention-system-setup/umc/python/setup/network.py
index ce6039f..4d945e6 100644
--- a/branches/ucs-3.2/ucs-3.2-3/base/univention-system-setup/umc/python/setup/network.py
+++ b/branches/ucs-3.2/ucs-3.2-3/base/univention-system-setup/umc/python/setup/network.py
@@ -744,7 +741,7 @@ class Bond(Device):
 				'bond-slaves %s' % (' '.join(self.bond_slaves),),
 				'bond-mode %s' % (self.bond_mode,),
 				]
-		if self.bond_mode == 1 and self.bond_primary:
+		if self.bond_mode in (1, '1') and self.bond_primary:
 			options.append('bond-primary %s' % (' '.join(self.bond_primary),))
 		if self.miimon is not None:
 			options.append('bond-miimon %s' % (self.miimon,))
Comment 2 Philipp Hahn univentionstaff 2014-10-30 13:14:57 CET
Created attachment 6264 [details]
Fix bond-primary UCR variable
Comment 3 Florian Best univentionstaff 2014-11-21 16:56:15 CET
Set up from bond-mode 2 to bond-mode 1 saves also the bond-primary:

7,8c7,9
< interfaces/bond0/options/1: bond-mode 2
< interfaces/bond0/options/2: bond-slaves eth0 eth1
---
> interfaces/bond0/options/1: bond-mode 1
> interfaces/bond0/options/2: bond-primary eth1
> interfaces/bond0/options/3: bond-slaves eth0 eth1

YAML: 2014-11-21-univention-system-setup.yaml
Comment 4 Philipp Hahn univentionstaff 2014-11-28 07:42:17 CET
OK: r56048
OK: aptitude install '?source-package(univention-system-setup)?installed'
OK: cat /etc/network/interfaces
OK: cat /sys/class/net/bond0/bonding/primary
OK: 2014-11-21-univention-system-setup.yaml
FIXED: announce_errata.pmh -V 2014-11-21-univention-system-setup.yaml
 wrap, "MII monitoring", German -> r56267
Comment 5 Moritz Muehlenhoff univentionstaff 2014-12-03 14:49:27 CET
http://errata.univention.de/ucs/3.2/246.html