Whamcloud - gitweb
Merge b_md to HEAD for 0.5.19 release.
[fs/lustre-release.git] / lustre / tests / uml.sh
1 #!/bin/bash
2
3 config=${1-uml.xml}
4 LMC=${LMC-../utils/lmc}
5 TMP=${TMP:-/tmp}
6
7 MDSDEV=$TMP/mds1
8 MDSSIZE=50000
9
10 OSTDEV1=$TMP/ost1
11 OSTDEV2=$TMP/ost2
12 OSTSIZE=100000
13
14 # NOTE - You can't have different MDS/OST nodes and also have clients on the
15 #        MDS/OST nodes without using --endlevel and --startlevel during lconf.
16 #        You can put both MDS/OST on one node and client can be there too.
17 #        CLIENTS is a space-separated list of client nodes.
18 #
19 #        The rule is that both the MDS and the OST must be set up before any
20 #        of the clients can be started, so plan accordingly.
21
22 # Three separate systems
23 MDSNODE=uml1
24 OSTNODES="uml2 uml2"
25 CLIENTS="uml3"
26
27 # Single system with additional clients
28 #MDSNODE=uml1
29 #OSTNODES="uml1 uml1"
30 #CLIENTS="$MDSNODE client"
31
32 # Two systems with client on MDS, and additional clients (set up OST first)
33 #MDSNODE=uml1
34 #OSTNODES="uml2 uml2"
35 #CLIENTS="$MDSNODE client"
36
37 # Two systems with client on OST, and additional clients (set up MDS first)
38 #MDSNODE=uml1
39 #OSTNODES="uml2 uml2"
40 #CLIENTS="$OSTNODES client"
41
42 rm -f $config
43
44 # create nodes
45 for NODE in $MDSNODE $OSTNODES $CLIENTS; do
46         eval [ \$$NODE ] && continue
47         ${LMC} -m $config --add net --node $NODE --nid $NODE --nettype tcp || exit 1
48         eval "$NODE=done"
49 done
50
51 # configure mds server
52 ${LMC} -m $config --add mds --format --node $MDSNODE --mds mds1 --dev $MDSDEV --size $MDSSIZE ||exit 10
53
54 # configure ost
55 ${LMC} -m $config --add lov --lov lov1 --mds mds1 --stripe_sz 65536 --stripe_cnt 0 --stripe_pattern 0 || exit 20
56 COUNT=1
57 for NODE in $OSTNODES; do
58         eval OSTDEV=\$OSTDEV$COUNT
59         ${LMC} -m $config --add ost --node $NODE --lov lov1 --dev $OSTDEV --size $OSTSIZE || exit 21
60         COUNT=`expr $COUNT + 1`
61 done
62
63 # create client config(s)
64 for NODE in $CLIENTS; do
65         ${LMC} -m $config --add mtpt --node $NODE --path /mnt/lustre --mds mds1 --lov lov1 || exit 30
66 done