summaryrefslogtreecommitdiffstats
path: root/src/test/cli/crushtool/build.t
blob: 89d56abeea7dad0e3a461299e9c273f746430b12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  $ map="$TESTDIR/build.crushmap"

#
# display the crush tree by default
#
  $ crushtool --outfn "$map" --build --num_osds 5 node straw 2 rack straw 1 root straw 0

#  
# silence all messages with --debug-crush 0
#
  $ CEPH_ARGS="--debug-crush 0" crushtool --outfn "$map" --build --num_osds 5 node straw 2 rack straw 1 root straw 0

#
# display a warning if there is more than one root
#
  $ crushtool --outfn "$map" --build --num_osds 5 node straw 2 rack straw 1 
  The crush rules will use the root rack0 (re)
  and ignore the others.
  There are 3 roots, they can be
  grouped into a single root by appending something like:
    root straw 0
  
#
# crush rules are generated using the OSDMap helpers
#
  $ CEPH_ARGS="--debug-crush 0" crushtool --outfn "$map" --set-straw-calc-version 0 --build --num_osds 1 root straw 0 --set-chooseleaf-stable 0
  $ crushtool -o "$map.txt" -d "$map"
  $ cat "$map.txt"
  # begin crush map
  tunable choose_local_tries 0
  tunable choose_local_fallback_tries 0
  tunable choose_total_tries 50
  tunable chooseleaf_descend_once 1
  tunable chooseleaf_vary_r 1
  tunable allowed_bucket_algs 54
  
  # devices
  device 0 osd.0
  
  # types
  type 0 osd
  type 1 root
  
  # buckets
  root root {
  \tid -1\t\t# do not change unnecessarily (esc)
  \t# weight 1.00000 (esc)
  \talg straw (esc)
  \thash 0\t# rjenkins1 (esc)
  \titem osd.0 weight 1.00000 (esc)
  }
  
  # rules
  rule replicated_rule {
  \tid 0 (esc)
  \ttype replicated (esc)
  \tstep take root (esc)
  \tstep chooseleaf firstn 0 type root (esc)
  \tstep emit (esc)
  }
  
  # end crush map
  $ rm "$map" "$map.txt"

#
# Wrong number of arguments 
#
  $ crushtool --outfn "$map" --debug-crush 0 --build --num_osds 5 node straw 0
  remaining args: [--debug-crush,0,node,straw,0]
  layers must be specified with 3-tuples of (name, buckettype, size)
  [1]

# Local Variables:
# compile-command: "cd ../../.. ; make crushtool && test/run-cli-tests"
# End: