Permalink
Browse files

CA-90457: Don't set rebalance-interval for LACP bonds.

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information...
1 parent 0cbfab0 commit e9219fab22c574028f2c4ce6fa3649e3e8e8596e @johnelse johnelse committed with Sep 14, 2012
Showing with 9 additions and 5 deletions.
  1. +3 −3 ocaml/network/network_utils.ml
  2. +6 −2 ocaml/xapi/nm.ml
@@ -717,9 +717,9 @@ module Ovs = struct
else
[]
in
- let extra_args = List.flatten (List.map get_prop ["updelay", "bond_updelay"; "downdelay", "bond_downdelay";
- "miimon", "other-config:bond-miimon-interval"; "use_carrier", "other-config:bond-detect-mode";
- "rebalance-interval", "other-config:bond-rebalance-interval"]) in
+ let extra_args = List.flatten (List.map get_prop (["updelay", "bond_updelay"; "downdelay", "bond_downdelay";
+ "miimon", "other-config:bond-miimon-interval"; "use_carrier", "other-config:bond-detect-mode";]
+ @ (if (List.mem_assoc "mode" properties) && (List.assoc "mode" properties = "lacp") then [] else ["rebalance-interval", "other-config:bond-rebalance-interval"]))) in
let other_args = List.filter_map (fun (k, v) ->
if List.mem k known_props then None
else Some (Printf.sprintf "other-config:\"%s\"=\"%s\"" (String.escaped ("bond-" ^ k)) (String.escaped v))
View
@@ -133,15 +133,19 @@ let create_bond ~__context bond mtu =
else
""
in
+ let rebalance_interval =
+ if mode = `lacp
+ then []
+ else ["rebalance-interval", "1800000"]
+ in
let props = [
"mode", Record_util.bond_mode_to_string mode;
"miimon", "100";
"downdelay", "200";
"updelay", "31000";
"use_carrier", "1";
"hashing-algorithm", hashing_algorithm;
- "rebalance-interval", "1800000";
- ] in
+ ] @ rebalance_interval in
let overrides = List.filter_map (fun (k, v) ->
if String.startswith "bond-" k then
Some ((String.sub_to_end k 5), v)

0 comments on commit e9219fa

Please sign in to comment.