From ced01fbac9af1d7ac64e1104642ebb5ee4c67205 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Thu, 17 May 2012 11:17:15 +0000 Subject: [PATCH] 1. bond-mld is shipped seperately, we should give admin the ability of putting it to different directory and using it. 2. while configuring bond0, only the correctly configured hfx interfaces can be added as bonding slaves. so admin don't need to adjust the interface num git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12762 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/confighfi | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/xCAT/postscripts/confighfi b/xCAT/postscripts/confighfi index d6cd28b40..3950c15d5 100644 --- a/xCAT/postscripts/confighfi +++ b/xCAT/postscripts/confighfi @@ -14,6 +14,11 @@ PLTFRM=`uname` NETMASK=255.0.0.0 +# bond-mld binary is shipped seperately, admin should adjust the following PATH +# to where bond-mld binary is. +PATH=$PATH:/usr/local/sbin/ +export PATH + name=`echo $NODE | awk -F-hf '{print $1}'` if [ -z $name ] then @@ -73,7 +78,14 @@ ONBOOT=yes done # Configure bond0 on Linux - CLIENT_IP=`ping -c 3 $name-bond0 -I hf$i 2>/dev/null | grep "data" | sed 's/.* (\([0-9.]*\)).*/\1/' | uniq 2>&1` + if lsmod | grep bonding + then + rmmod bonding + fi + + modprobe bonding mode=multi-link miimon=100 xmit_hash_policy=layer3+4 + + CLIENT_IP=`ping -c 3 $name-bond0 -I bond0 2>/dev/null | grep "data" | sed 's/.* (\([0-9.]*\)).*/\1/' | uniq 2>&1` if [ -n "$CLIENT_IP" ] then echo "DEVICE=bond0 @@ -84,22 +96,11 @@ ONBOOT=yes " >/etc/sysconfig/network-scripts/ifcfg-bond0 fi - if lsmod | grep bonding - then - rmmod bonding - fi - - modprobe bonding mode=multi-link miimon=100 xmit_hash_policy=layer3+4 - - sleep 1 - - # Starting from HFI DD2.1, there are 8 interfaces per io hub. You will need to - # adjust following line to only include hf0,hf1,hf2,hf3 if you are working with - # HFI DD2.0 devices. - for x in hf0 hf1 hf2 hf3 hf4 hf5 hf6 hf7; do - - ip link set dev ${x} down - echo +${x} > /sys/class/net/bond0/bonding/slaves + x=0 + while [ $x -le $i ]; do + ip link set dev hf${x} down + echo +hf${x} > /sys/class/net/bond0/bonding/slaves + x=$((x+1)) done bond-mld > m.out 2>&1 &