2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 03:00:26 +00:00

Allow confignetwork to setup an IB bond

This commit is contained in:
Matt Ezell
2017-11-06 21:35:11 -05:00
parent 66bacfb8c0
commit 4b373a7244
2 changed files with 28 additions and 9 deletions

View File

@@ -297,6 +297,7 @@ function sort_nics_device_order {
all_nics_list=$*
eth_slot=""
ib_slot=""
bond_slot=""
vlan_slot=""
ib_slots=""
@@ -394,6 +395,16 @@ function sort_nics_device_order {
eth_slot=$eth_slot" "$num
fi
#valid nic_dev and base_nic_dev pair as bond-infiniband
elif [ x"$base_nic_type" = "xinfiniband" ]&& \
[ x"$nic_dev_type" = "xbond" ]; then
if [ x"$ib_slot" = x ]; then
ib_slot=$num
else
ib_slot=$ib_slot" "$num
fi
#valid nic_dev and base_nic_dev pair as vlan-bond or bridge-bond
elif [ x"$base_nic_type" = "xbond" ]&& \
[ x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then
@@ -422,7 +433,7 @@ function sort_nics_device_order {
log_error "Only support configuration of Bond/VLAN/Bridge on Red Hat."
fi
fi
new_order=$eth_slot" "$bond_slot" "$vlan_slot
new_order=$eth_slot" "$ib_slot" "$bond_slot" "$vlan_slot
new_order_list=""
if [ -n "$new_order" ]; then
@@ -557,7 +568,7 @@ function configure_nicdevice {
#configure bond
elif [ x"$nic_dev_type" = "xbond" ]; then
create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond
create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type
elif [ x"$nic_dev_type" = "xinfiniband" ]; then
log_info "Call configib for IB nics: $nic_dev, ports: $num_iba_ports"
log_info "NIC_IBNICS=$nic_dev NIC_IBAPORTS=$num_iba_ports configib"

View File

@@ -1263,11 +1263,7 @@ function create_bond_interface {
local xcatnet=""
local _ipaddr=""
local _netmask=""
# note:
# - "miimon" requires drivers for each slave nic support MII tool.
# $ ethtool <interface_name> | grep "Link detected:"
# - "802.3ad" mode requires a switch that is 802.3ad compliant.
local _bonding_opts="mode=802.3ad miimon=100"
local _bonding_opts=""
local _mtu=""
local slave_ports=""
# parser input arguments
@@ -1280,7 +1276,8 @@ function create_bond_interface {
[ "$key" = "_netmask" ] || \
[ "$key" = "_bonding_opts" ] || \
[ "$key" = "_mtu" ] || \
[ "$key" = "slave_ports" ]; then
[ "$key" = "slave_ports" ] || \
[ "$key" = "slave_type" ]; then
eval "$1"
fi
shift
@@ -1290,6 +1287,17 @@ function create_bond_interface {
log_error "No valid slave_ports defined. Abort!"
return 1
fi
if [ -z "$slave_type" ] || [ x"$slave_type" = "xethernet" ]; then
slave_type="Ethernet"
# note:
# - "miimon" requires drivers for each slave nic support MII tool.
# $ ethtool <interface_name> | grep "Link detected:"
# - "802.3ad" mode requires a switch that is 802.3ad compliant.
_bonding_opts="mode=802.3ad miimon=100"
elif [ "$slave_type" = "infiniband" ]; then
slave_type="Infiniband"
_bonding_opts="mode=1 miimon=100 fail_over_mac=1"
fi
# let's query "nicnetworks" table about its target "xcatnet"
if [ -n "$ifname" -a -z "$xcatnet" -a -z "$_ipaddr" ]; then
xcatnet=`query_nicnetworks_net $ifname`
@@ -1414,7 +1422,7 @@ function create_bond_interface {
fi
cfg="${cfg}${cfg:+,}USERCTL=no"
cfg="${cfg}${cfg:+,}TYPE=Ethernet"
cfg="${cfg}${cfg:+,}TYPE=$slave_type"
cfg="${cfg}${cfg:+,}SLAVE=yes"
cfg="${cfg}${cfg:+,}MASTER=$ifname"
cfg="${cfg}${cfg:+,}BOOTPROTO=none"