summaryrefslogtreecommitdiffstats
path: root/src/test/cli/crushtool/rules.t
blob: e90ddbcf7cbfea8198de06cea4d931c2c36c1af9 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
  $ crushtool -c $TESTDIR/rules.txt --create-replicated-rule foo default host -o one > /dev/null
  $ crushtool -d one
  # begin crush map
  
  # devices
  device 0 osd.0 class ssd
  device 1 osd.1 class ssd
  device 2 osd.2 class ssd
  device 3 osd.3 class hdd
  device 4 osd.4 class hdd
  device 5 osd.5 class hdd
  
  # types
  type 0 osd
  type 1 host
  type 2 root
  
  # buckets
  host foo {
  \tid -3\t\t# do not change unnecessarily (esc)
  \tid -4 class ssd\t\t# do not change unnecessarily (esc)
  \tid -7 class hdd\t\t# do not change unnecessarily (esc)
  \t# weight 3.000 (esc)
  \talg straw2 (esc)
  \thash 0\t# rjenkins1 (esc)
  \titem osd.0 weight 1.000 (esc)
  \titem osd.1 weight 1.000 (esc)
  \titem osd.2 weight 1.000 (esc)
  }
  host bar {
  \tid -2\t\t# do not change unnecessarily (esc)
  \tid -5 class ssd\t\t# do not change unnecessarily (esc)
  \tid -8 class hdd\t\t# do not change unnecessarily (esc)
  \t# weight 3.000 (esc)
  \talg straw2 (esc)
  \thash 0\t# rjenkins1 (esc)
  \titem osd.3 weight 1.000 (esc)
  \titem osd.4 weight 1.000 (esc)
  \titem osd.5 weight 1.000 (esc)
  }
  root default {
  \tid -1\t\t# do not change unnecessarily (esc)
  \tid -6 class ssd\t\t# do not change unnecessarily (esc)
  \tid -9 class hdd\t\t# do not change unnecessarily (esc)
  \t# weight 6.000 (esc)
  \talg straw2 (esc)
  \thash 0\t# rjenkins1 (esc)
  \titem foo weight 3.000 (esc)
  \titem bar weight 3.000 (esc)
  }
  
  # rules
  rule data {
  \tid 0 (esc)
  \ttype replicated (esc)
  \tmin_size 1 (esc)
  \tmax_size 10 (esc)
  \tstep take default (esc)
  \tstep chooseleaf firstn 0 type host (esc)
  \tstep emit (esc)
  }
  rule foo {
  \tid 1 (esc)
  \ttype replicated (esc)
  \tmin_size 1 (esc)
  \tmax_size 10 (esc)
  \tstep take default (esc)
  \tstep chooseleaf firstn 0 type host (esc)
  \tstep emit (esc)
  }
  
  # end crush map










  $ crushtool -c $TESTDIR/rules.txt --create-replicated-rule foo-ssd default host -o two --device-class ssd > /dev/null
  $ crushtool -d two
  # begin crush map
  
  # devices
  device 0 osd.0 class ssd
  device 1 osd.1 class ssd
  device 2 osd.2 class ssd
  device 3 osd.3 class hdd
  device 4 osd.4 class hdd
  device 5 osd.5 class hdd
  
  # types
  type 0 osd
  type 1 host
  type 2 root
  
  # buckets
  host foo {
  \tid -3\t\t# do not change unnecessarily (esc)
  \tid -4 class ssd\t\t# do not change unnecessarily (esc)
  \tid -7 class hdd\t\t# do not change unnecessarily (esc)
  \t# weight 3.000 (esc)
  \talg straw2 (esc)
  \thash 0\t# rjenkins1 (esc)
  \titem osd.0 weight 1.000 (esc)
  \titem osd.1 weight 1.000 (esc)
  \titem osd.2 weight 1.000 (esc)
  }
  host bar {
  \tid -2\t\t# do not change unnecessarily (esc)
  \tid -5 class ssd\t\t# do not change unnecessarily (esc)
  \tid -8 class hdd\t\t# do not change unnecessarily (esc)
  \t# weight 3.000 (esc)
  \talg straw2 (esc)
  \thash 0\t# rjenkins1 (esc)
  \titem osd.3 weight 1.000 (esc)
  \titem osd.4 weight 1.000 (esc)
  \titem osd.5 weight 1.000 (esc)
  }
  root default {
  \tid -1\t\t# do not change unnecessarily (esc)
  \tid -6 class ssd\t\t# do not change unnecessarily (esc)
  \tid -9 class hdd\t\t# do not change unnecessarily (esc)
  \t# weight 6.000 (esc)
  \talg straw2 (esc)
  \thash 0\t# rjenkins1 (esc)
  \titem foo weight 3.000 (esc)
  \titem bar weight 3.000 (esc)
  }
  
  # rules
  rule data {
  \tid 0 (esc)
  \ttype replicated (esc)
  \tmin_size 1 (esc)
  \tmax_size 10 (esc)
  \tstep take default (esc)
  \tstep chooseleaf firstn 0 type host (esc)
  \tstep emit (esc)
  }
  rule foo-ssd {
  \tid 1 (esc)
  \ttype replicated (esc)
  \tmin_size 1 (esc)
  \tmax_size 10 (esc)
  \tstep take default class ssd (esc)
  \tstep chooseleaf firstn 0 type host (esc)
  \tstep emit (esc)
  }
  
  # end crush map