]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crushtool: implement --reclassify
authorSage Weil <sage@redhat.com>
Fri, 5 Oct 2018 17:47:37 +0000 (12:47 -0500)
committerSage Weil <sage@redhat.com>
Tue, 16 Oct 2018 13:50:23 +0000 (08:50 -0500)
commit43ce1877a714b04f2c1c6ad09b1d60944d25dfeb
treeeb3f610990206e33c93662caa824051615f5475f
parentb1aa517a88524b7b094325ce8ab77cc19c27c20e
crushtool: implement --reclassify

Add two modes of reclassification of existing hierarchies:

--classify-root <rootname> <class> will rewrite a hierarchy from an
existing root so that all of its devices are a different class.  Rules
that reference that root will be implicitly adjusted to 'take <rootname>
class <class>'. Ids will be preserved.

--classify-bucket <match> <class> <default-parent> will match a pattern
in the bucket name, where % at the beginning or end of the string is used
as a wildcard (e.g., "%-ssd" will match an "-ssd" suffix, "foo-%" will
match a "foo-" prefix).  Each such bucket is mapped to a "base" bucket
(with the suffix or prefix), items are labeled with the appropriate
class and the moved to that base bucket, and rules adjusted.  The
<default-parent> is used as the parent if the base bucket doesn't exist
and has to be created.

Similarly,
--classify-bucket <bucket> <class> <base-bucket> does the same but
a single existing bucket is mapped to an existing base bucket.  For
example, there is often an 'ssd' bucket that is the counterpart for
the 'default' root; '--classify-bucket ssd ssd default' will map it over.

Signed-off-by: Sage Weil <sage@redhat.com>
12 files changed:
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h
src/test/cli/crushtool/crush-classes/Eric.Smith@ccur.com [new file with mode: 0644]
src/test/cli/crushtool/crush-classes/dan@vanderster.com-beesly.crush [new file with mode: 0644]
src/test/cli/crushtool/crush-classes/dan@vanderster.com-flax.crush [new file with mode: 0644]
src/test/cli/crushtool/crush-classes/dan@vanderster.com-gabe.crush [new file with mode: 0644]
src/test/cli/crushtool/crush-classes/iversons@rushville.k12.in.us [new file with mode: 0644]
src/test/cli/crushtool/crush-classes/jwillem@stads.net [new file with mode: 0644]
src/test/cli/crushtool/crush-classes/michael.nieporte@uk-essen.de [new file with mode: 0644]
src/test/cli/crushtool/help.t [changed mode: 0755->0644]
src/test/cli/crushtool/reclassify.t [new file with mode: 0644]
src/tools/crushtool.cc