Whamcloud - gitweb
adjust krb5 related scripts, add krb5 support in replay-ost-single,
[fs/lustre-release.git] / lustre / tests / mcr-routed-config.sh
index bcf0d17..7db8887 100755 (executable)
@@ -1,84 +1,87 @@
 #!/bin/bash
 
-config=${1:-mcr2.xml}
+BASE=`hostname | sed "s/[i0-9]*$//"`
+[ $BASE = "mcr" ] && OSTBASE=${OSTBASE:-ba} || OSTBASE=${OSTBASE:-ba-ost-}
+
+config=${1:-$BASE.xml}
+
+BATCH=/tmp/lmc-batch.$$
+save_cmd() {
+    echo "$@" >> $BATCH
+}
 
 LMC="save_cmd"
-LMC_REAL="../../lustre/utils/lmc -m $config"
+LMC_REAL="../utils/lmc -m $config"
 
 # TCP/IP servers
-SERVER_START=1
-SERVER_CNT=62
-GW_START=1
-GW_CNT=31
-MDS=mcr23
-UUIDLIST=${UUIDLIST:-/home/bluearc/UUID.0920}
-
-# THis is needed for to create route for elan network
-CLIENT_LO=mcr40
-CLIENT_HI=mcr96
-
-PORT=2432
+SERVER_START=0
+SERVER_CNT=32
+GW_START=0
+GW_CNT=16
+MDS=${BASE}23
+UUIDLIST=${UUIDLIST:-/usr/local/admin/ba-ost/UUID.txt}
+
+echo "MDS: $MDS"
+
+# This is needed for to create route for elan network
+CLIENT_LO=38
+CLIENT_HI=191
+
 TCPBUF=1048576
  
-
 h2elan () {
     echo $1 | sed 's/[^0-9]*//g'
 }
 
-h2ip () {
+h2tcp () {
     echo "${1}"
 }
-# map gwNN to mcrNN
-# assumes /etc/hosts looks like this:
-# 192.168.40.11        emcr10  mcr10-eth0      emcr-r2-s1      gw10
-gw2mcr() {
-    awk '$5 = /'$1'$/ {print substr($2,2)}'  /etc/hosts
-}
-BATCH=/tmp/lmc-batch.$$
-save_cmd() {
-    echo "$@" >> $BATCH
+
+# map gateway NN to host NN (assumes mcr[22-25] are not gateways)
+gw2node() {
+       [ $1 -gt 21 ] && echo $(($1 + 4)) || echo $1
 }
 
 [ -f $config ] && rm $config
 
-${LMC} --node $MDS --net `h2elan $MDS` elan || exit 1
-${LMC} --node $MDS --mds mds1 /tmp/mds1 100000 || exit 1
-${LMC} --lov lov1 mds1 65536 0 0
+${LMC} --add net --node $MDS --nid `h2elan $MDS` --nettype elan || exit 1
+${LMC} --add mds --node $MDS --mds mds1 --dev /tmp/mds1 --size 100000 || exit 1
+${LMC} --add lov --lov lov1 --mds mds1 --stripe_sz 1048576 --stripe_cnt 1 --stripe_pattern 0
 
 # Client node
-#${LMC} --node client --tcpbuf $TCPBUF --net '*' tcp $PORT || exit 1
-${LMC} --node client --net '*' elan || exit 1
-${LMC} --node client --mtpt /mnt/lustre mds1 lov1
+#${LMC} --add net --node client --tcpbuf $TCPBUF --nid '*' --nettype tcp || exit 1
+${LMC} --add net --node client --nid '*' --nettype elan || exit 1
+${LMC} --add mtpt --node client --path /mnt/lustre --clientoptions async --mds mds1 --lov lov1
 
 # this is crude, but effective
 let server_per_gw=($SERVER_CNT / $GW_CNT )
 let tot_server=$server_per_gw*$GW_CNT
-echo "Allocating $server_per_gw per gateway."
-echo "For a total of $tot_server Blue Arcs"
+echo "Allocating $server_per_gw OSTs per gateway."
+echo "For a total of $tot_server Blue Arc OSTs"
 
 let gw=$GW_START
 let server=$SERVER_START
 while (( $gw < $GW_CNT + GW_START ));
 do 
-   echo "gw$gw"
-   gwnode=`gw2mcr gw$gw`
-   ${LMC} --router --node $gwnode --tcpbuf $TCPBUF --net `h2ip $gwnode`  tcp $PORT || exit 1
-   ${LMC} --node $gwnode --net `h2elan $gwnode` elan|| exit 1
-   ${LMC} --node $gwnode --route elan `h2elan $gwnode` `h2elan $CLIENT_LO` `h2elan $CLIENT_HI` || exit 2
+   gwnode=$BASE`gw2node $gw`
+   echo "Router: $gwnode"
+   ${LMC} --add net --router --node $gwnode --tcpbuf $TCPBUF --nid `h2tcp $gwnode`  --nettype tcp || exit 1
+   ${LMC} --add net --node $gwnode --nid `h2elan $gwnode` --nettype elan || exit 1
+   ${LMC} --add route --node $gwnode --nettype elan --gw `h2elan $gwnode` --lo `h2elan $CLIENT_LO` --hi `h2elan $CLIENT_HI` || exit 2
 
    let  i=0
    while (( $i < $server_per_gw ));
    do
-      echo "server: $server"
-      ba=ba$server
-      OBD_UUID=`awk "/$OST / { print \\$3 }" $UUIDLIST`
-      [ "$OBD_UUID" ] && OBD_UUID="--obduuid=$OBD_UUID" || echo "$OST: no UUID"
+      OST=${OSTBASE}$server
+      echo "server: $OST"
+      OST_UUID=`awk "/$OST / { print \\$3 }" $UUIDLIST`
+      [ "$OST_UUID" ] && OST_UUID="--ostuuid $OST_UUID" || echo "$OST: no UUID"
       # server node
-      ${LMC} --node $ba --tcpbuf $TCPBUF --net $ba tcp $PORT || exit 1
+      ${LMC} --add net --node $OST --tcpbuf $TCPBUF --nid $OST --nettype tcp || exit 1
       # the device on the server
-      ${LMC} --lov lov1 --node $ba $OBD_UUID --ost bluearc || exit 3
+      ${LMC} --add ost --lov lov1 --node $OST $OBD_UUID --dev bluearc || exit 3
       # route to server
-      ${LMC} --node $gwnode --route tcp `h2ip $gwnode` $ba || exit 2
+      ${LMC} --add route --node $gwnode --nettype tcp --gw `h2tcp $gwnode` --lo $OST || exit 2
       let server=$server+1 
       let i=$i+1
    done