mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Add/update more bonding driver parameters
This commit is contained in:
parent
3f80f869aa
commit
46060e095f
@ -38,7 +38,11 @@ _RH_CONFIG_OPTS = [
|
||||
_RH_CONFIG_BONDING_OPTS = [
|
||||
'mode', 'miimon', 'arp_interval',
|
||||
'arp_ip_target', 'downdelay', 'updelay',
|
||||
'use_carrier', 'lacp_rate', 'hashing-algorithm'
|
||||
'use_carrier', 'lacp_rate', 'hashing-algorithm',
|
||||
'max_bonds', 'tx_queues', 'num_grat_arp',
|
||||
'num_unsol_na', 'primary', 'primary_reselect',
|
||||
'ad_select', 'xmit_hash_policy', 'arp_validate',
|
||||
'fail_over_mac', 'all_slaves_active', 'resend_igmp'
|
||||
]
|
||||
_RH_NETWORK_SCRIPT_DIR = '/etc/sysconfig/network-scripts'
|
||||
_RH_NETWORK_FILE = '/etc/sysconfig/network'
|
||||
@ -153,10 +157,18 @@ def _parse_settings_bond(opts, iface):
|
||||
'''
|
||||
|
||||
bond_def = {
|
||||
# 803.ad aggregation selection logic
|
||||
# 0 for stable (default)
|
||||
# 1 for bandwidth
|
||||
# 2 for count
|
||||
'ad_select' : '0',
|
||||
# Max number of transmit queues (default = 16)
|
||||
'tx_queues' : '16',
|
||||
# Link monitoring in milliseconds. Most NICs support this
|
||||
'miimon': '100',
|
||||
# arp interval in milliseconds
|
||||
'arp_interval': '250',
|
||||
# miimon * 2
|
||||
# Delay before considering link down in milliseconds (miimon * 2)
|
||||
'downdelay': '200',
|
||||
# lacp_rate 0: Slow - every 30 seconds
|
||||
# lacp_rate 1: Fast - every 1 second
|
||||
@ -176,18 +188,25 @@ def _parse_settings_bond(opts, iface):
|
||||
}
|
||||
|
||||
if opts['mode'] in ['balance-rr', '0']:
|
||||
log.info('Device: %s Bonding Mode: load balancing (round-robin)' % (iface))
|
||||
return _parse_settings_bond_0(opts, iface, bond_def)
|
||||
elif opts['mode'] in ['active-backup', '1']:
|
||||
log.info('Device: %s Bonding Mode: fault-tolerance (active-backup)' % (iface))
|
||||
return _parse_settings_bond_1(opts, iface, bond_def)
|
||||
elif opts['mode'] in ['balance-xor', '2']:
|
||||
log.info('Device: %s Bonding Mode: load balancing (xor)' % (iface))
|
||||
return _parse_settings_bond_2(opts, iface, bond_def)
|
||||
elif opts['mode'] in ['broadcast', '3']:
|
||||
log.info('Device: %s Bonding Mode: fault-tolerance (broadcast)' % (iface))
|
||||
return _parse_settings_bond_3(opts, iface, bond_def)
|
||||
elif opts['mode'] in ['802.3ad', '4']:
|
||||
log.info('Device: %s Bonding Mode: IEEE 802.3ad Dynamic link aggregation' % (iface))
|
||||
return _parse_settings_bond_4(opts, iface, bond_def)
|
||||
elif opts['mode'] in ['balance-tlb', '5']:
|
||||
log.info('Device: %s Bonding Mode: transmit load balancing' % (iface))
|
||||
return _parse_settings_bond_5(opts, iface, bond_def)
|
||||
elif opts['mode'] in ['balance-alb', '6']:
|
||||
log.info('Device: %s Bonding Mode: adaptive load balancing' % (iface))
|
||||
return _parse_settings_bond_6(opts, iface, bond_def)
|
||||
else:
|
||||
valid = [
|
||||
@ -207,6 +226,7 @@ def _parse_settings_bond_0(opts, iface, bond_def):
|
||||
'''
|
||||
bond = {'mode': '0'}
|
||||
|
||||
# arp targets in n.n.n.n form
|
||||
valid = ['list of ips (up to 16)']
|
||||
if 'arp_ip_target' in opts:
|
||||
if isinstance(opts['arp_ip_target'], list):
|
||||
@ -364,7 +384,7 @@ def _parse_settings_bond_4(opts, iface, bond_def):
|
||||
|
||||
bond = {'mode': '4'}
|
||||
|
||||
for bo in ['miimon', 'downdelay', 'updelay', 'lacp_rate']:
|
||||
for bo in ['miimon', 'downdelay', 'updelay', 'lacp_rate', 'ad_select']:
|
||||
if bo in opts:
|
||||
if bo == 'lacp_rate':
|
||||
if opts[bo] == 'fast':
|
||||
|
Loading…
Reference in New Issue
Block a user