Whamcloud - gitweb
Add some extra comments and sample configs.
[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 OSTNODE=uml2
25 CLIENTS="uml3"
26
27 # Single system with additional clients
28 #MDSNODE=uml1
29 #OSTNODE=uml1
30 #CLIENTS="$MDSNODE client"
31
32 # Two systems with client on MDS, and additional clients (set up OST first)
33 #MDSNODE=uml1
34 #OSTNODE=uml2
35 #CLIENTS="$MDSNODE client"
36
37 # Two systems with client on OST, and additional clients (set up MDS first)
38 #MDSNODE=uml1
39 #OSTNODE=uml2
40 #CLIENTS="$OSTNODE client"
41
42 rm -f $config
43
44 # create nodes
45 for NODE in $MDSNODE $OSTNODE $CLIENTS; do
46         eval [ \$$NODE ] && continue
47         ${LMC} -m $config --node $NODE --net $NODE tcp || exit 1
48         eval "$NODE=done"
49 done
50
51 # configure mds server
52 ${LMC} -m $config --format --node $MDSNODE --mds mds1 $MDSDEV $MDSSIZE ||exit 10
53
54 # configure ost
55 ${LMC} -m $config  --lov lov1 mds1 65536 0 0 || exit 20
56 ${LMC} -m $config --node $OSTNODE --lov lov1 --ost $OSTDEV1 $OSTSIZE || exit 21
57 ${LMC} -m $config --node $OSTNODE --lov lov1 --ost $OSTDEV2 $OSTSIZE || exit 22
58
59 # create client config(s)
60 for NODE in $CLIENTS; do
61         ${LMC} -m $config  --node $NODE --mtpt /mnt/lustre mds1 lov1 || exit 30
62 done
63