Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / cli / crushtool / build.t
1   $ map="$TESTDIR/build.crushmap"
2
3 #
4 # display the crush tree by default
5 #
6   $ crushtool --outfn "$map" --build --num_osds 5 node straw 2 rack straw 1 root straw 0
7
8 #  
9 # silence all messages with --debug-crush 0
10 #
11   $ CEPH_ARGS="--debug-crush 0" crushtool --outfn "$map" --build --num_osds 5 node straw 2 rack straw 1 root straw 0
12
13 #
14 # display a warning if there is more than one root
15 #
16   $ crushtool --outfn "$map" --build --num_osds 5 node straw 2 rack straw 1 
17   The crush rulesets will use the root rack0 (re)
18   and ignore the others.
19   There are 3 roots, they can be
20   grouped into a single root by appending something like:
21     root straw 0
22   
23 #
24 # crush rulesets are generated using the OSDMap helpers
25 #
26   $ CEPH_ARGS="--debug-crush 0" crushtool --outfn "$map" --set-straw-calc-version 0 --build --num_osds 1 root straw 0 --set-chooseleaf-stable 0
27   $ crushtool -o "$map.txt" -d "$map"
28   $ cat "$map.txt"
29   # begin crush map
30   tunable choose_local_tries 0
31   tunable choose_local_fallback_tries 0
32   tunable choose_total_tries 50
33   tunable chooseleaf_descend_once 1
34   tunable chooseleaf_vary_r 1
35   tunable allowed_bucket_algs 54
36   
37   # devices
38   device 0 osd.0
39   
40   # types
41   type 0 osd
42   type 1 root
43   
44   # buckets
45   root root {
46   \tid -1\t\t# do not change unnecessarily (esc)
47   \t# weight 1.000 (esc)
48   \talg straw (esc)
49   \thash 0\t# rjenkins1 (esc)
50   \titem osd.0 weight 1.000 (esc)
51   }
52   
53   # rules
54   rule replicated_rule {
55   \tid 0 (esc)
56   \ttype replicated (esc)
57   \tmin_size 1 (esc)
58   \tmax_size 10 (esc)
59   \tstep take root (esc)
60   \tstep chooseleaf firstn 0 type root (esc)
61   \tstep emit (esc)
62   }
63   
64   # end crush map
65   $ rm "$map" "$map.txt"
66
67 #
68 # Wrong number of arguments 
69 #
70   $ crushtool --outfn "$map" --debug-crush 0 --build --num_osds 5 node straw 0
71   remaining args: [--debug-crush,0,node,straw,0]
72   layers must be specified with 3-tuples of (name, buckettype, size)
73   [1]
74
75 # Local Variables:
76 # compile-command: "cd ../../.. ; make crushtool && test/run-cli-tests"
77 # End: