1 $ crushtool -i "$TESTDIR/simple.template" --add-item 0 1.0 device0 --loc host host0 --loc cluster cluster0 -o one > /dev/null
2 $ crushtool -i one --add-item 1 1.0 device1 --loc host host0 --loc cluster cluster0 -o two > /dev/null
3 $ crushtool -i two --create-simple-rule simple-rule cluster0 host firstn -o two > /dev/null
18 \tid -2\t\t# do not change unnecessarily (esc)
19 \t# weight 2.000 (esc)
21 \thash 0\t# rjenkins1 (esc)
22 \titem device0 weight 1.000 (esc)
23 \titem device1 weight 1.000 (esc)
26 \tid -1\t\t# do not change unnecessarily (esc)
27 \t# weight 2.000 (esc)
29 \thash 0\t# rjenkins1 (esc)
30 \titem host0 weight 2.000 (esc)
36 \ttype replicated (esc)
39 \tstep take cluster0 (esc)
40 \tstep chooseleaf firstn 0 type host (esc)
45 \ttype replicated (esc)
48 \tstep take cluster0 (esc)
49 \tstep chooseleaf firstn 0 type host (esc)
54 \ttype replicated (esc)
57 \tstep take cluster0 (esc)
58 \tstep chooseleaf firstn 0 type host (esc)
63 \ttype replicated (esc)
66 \tstep take cluster0 (esc)
67 \tstep chooseleaf firstn 0 type host (esc)
72 $ crushtool -i two --remove-rule simple-rule -o two > /dev/null
87 \tid -2\t\t# do not change unnecessarily (esc)
88 \t# weight 2.000 (esc)
90 \thash 0\t# rjenkins1 (esc)
91 \titem device0 weight 1.000 (esc)
92 \titem device1 weight 1.000 (esc)
95 \tid -1\t\t# do not change unnecessarily (esc)
96 \t# weight 2.000 (esc)
98 \thash 0\t# rjenkins1 (esc)
99 \titem host0 weight 2.000 (esc)
105 \ttype replicated (esc)
108 \tstep take cluster0 (esc)
109 \tstep chooseleaf firstn 0 type host (esc)
114 \ttype replicated (esc)
117 \tstep take cluster0 (esc)
118 \tstep chooseleaf firstn 0 type host (esc)
123 \ttype replicated (esc)
126 \tstep take cluster0 (esc)
127 \tstep chooseleaf firstn 0 type host (esc)
132 $ crushtool -d two -o final
133 $ cmp final "$TESTDIR/simple.template.two"
134 $ crushtool -i two --add-item 1 1.0 device1 --loc host host0 --loc cluster cluster0 -o three 2>/dev/null >/dev/null || echo FAIL
136 $ crushtool -i two --remove-item device1 -o four > /dev/null
137 $ crushtool -d four -o final
138 $ cmp final "$TESTDIR/simple.template.four"
139 $ crushtool -i two --update-item 1 2.0 osd1 --loc host host1 --loc cluster cluster0 -o five > /dev/null
140 $ crushtool -d five -o final
141 $ cmp final "$TESTDIR/simple.template.five"
142 $ crushtool -i five --update-item 1 2.0 osd1 --loc host host1 --loc cluster cluster0 -o six > /dev/null
143 $ crushtool -i five --show-location 1
144 cluster\tcluster0 (esc)
146 $ crushtool -d six -o final
147 $ cmp final "$TESTDIR/simple.template.five"