2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-23 11:40:25 +00:00

Merge pull request #6705 from Obihoernchen/nicutils-fixes

Multiple nicutils.sh fixes
This commit is contained in:
cxhong
2020-05-28 16:37:07 -04:00
committed by GitHub

View File

@@ -289,6 +289,10 @@ function load_kmod {
#
#################################################################
function query_extra_params {
# reset global variables
unset array_nic_params
unset array_extra_param_names
unset array_extra_param_values
nic=$1
if [ -z "$nic" ]; then
@@ -479,9 +483,6 @@ function create_persistent_ifcfg {
local _netmask=""
local _mtu=""
local inattrs=""
unset array_nic_params
unset array_extra_param_names
unset array_extra_param_values
# parser input arguments
while [ -n "$1" ];
@@ -2134,7 +2135,7 @@ function create_bond_interface_nmcli {
else
_bonding_opts="mode=active-backup"
fi
if [ -z "$next_nic" ]; then
if [ -n "$_ipaddr" ]; then
# query "nicnetworks" table about its target "xcatnet"
xcatnet=$(query_nicnetworks_net $bondname)
log_info "Pickup xcatnet, \"$xcatnet\", from NICNETWORKS for interface \"$bondname\"."
@@ -2197,7 +2198,7 @@ function create_bond_interface_nmcli {
# create raw bond device
log_info "create bond connection $xcat_con_name"
cmd=""
if [ -n "$next_nic" ]; then
if [ -z "$_ipaddr" ]; then
cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts ipv4.method disabled ipv6.method ignore autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0"
else
cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0"
@@ -2245,6 +2246,10 @@ function create_bond_interface_nmcli {
$ip link set dev $ifslave down
wait_for_ifstate $ifslave DOWN 20 2
fi
# InfiniBand slaves should have no MTU defined, only the bond interface
if [ "$slave_type" = "Infiniband" ]; then
_mtu=""
fi
cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu ifname $ifslave master $xcat_con_name slave-type bond autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-retries 0"
log_info $cmd
$cmd
@@ -2285,7 +2290,7 @@ function create_bond_interface_nmcli {
# bring up interface formally
log_info "$nmcli con up $xcat_con_name"
$nmcli con up $xcat_con_name
if [ -z "$next_nic" ]; then
if [ -n "$_ipaddr" ]; then
is_connection_activate_intime $xcat_con_name
is_active=$?
if [ "$is_active" -eq 0 ]; then