3 BASE=`hostname | sed "s/[i0-9]*$//"`
4 [ $BASE = "mcr" ] && OSTBASE=${OSTBASE:-ba} || OSTBASE=${OSTBASE:-ba-ost-}
8 BATCH=/tmp/lmc-batch.$$
14 LMC_REAL="../../lustre/utils/lmc -m $config"
22 UUIDLIST=${UUIDLIST:-/usr/local/admin/ba-ost/UUID.txt}
26 # This is needed for to create route for elan network
33 echo $1 | sed 's/[^0-9]*//g'
40 # map gateway NN to host NN (assumes mcr[22-25] are not gateways)
42 [ $1 -gt 21 ] && echo $(($1 + 4)) || echo $1
45 [ -f $config ] && rm $config
47 ${LMC} --node $MDS --net `h2elan $MDS` elan || exit 1
48 ${LMC} --node $MDS --mds mds1 /tmp/mds1 100000 || exit 1
49 ${LMC} --lov lov1 mds1 65536 1 0
52 #${LMC} --node client --tcpbuf $TCPBUF --net '*' tcp || exit 1
53 ${LMC} --node client --net '*' elan || exit 1
54 ${LMC} --node client --mtpt /mnt/lustre mds1 lov1
56 # this is crude, but effective
57 let server_per_gw=($SERVER_CNT / $GW_CNT )
58 let tot_server=$server_per_gw*$GW_CNT
59 echo "Allocating $server_per_gw OSTs per gateway."
60 echo "For a total of $tot_server Blue Arc OSTs"
63 let server=$SERVER_START
64 while (( $gw < $GW_CNT + GW_START ));
66 gwnode=$BASE`gw2node $gw`
67 echo "Router: $gwnode"
68 ${LMC} --router --node $gwnode --tcpbuf $TCPBUF --net `h2ip $gwnode` tcp || exit 1
69 ${LMC} --node $gwnode --net `h2elan $gwnode` elan|| exit 1
70 ${LMC} --node $gwnode --route elan `h2elan $gwnode` `h2elan $CLIENT_LO` `h2elan $CLIENT_HI` || exit 2
73 while (( $i < $server_per_gw ));
77 OBD_UUID=`awk "/$OST / { print \\$3 }" $UUIDLIST`
78 [ "$OBD_UUID" ] && OBD_UUID="--obduuid=$OBD_UUID" || echo "$OST: no UUID"
80 ${LMC} --node $OST --tcpbuf $TCPBUF --net $OST tcp || exit 1
81 # the device on the server
82 ${LMC} --lov lov1 --node $OST $OBD_UUID --ost bluearc || exit 3
84 ${LMC} --node $gwnode --route tcp `h2ip $gwnode` $OST || exit 2
92 $LMC_REAL --batch $BATCH