New command to create crush rule that specifies a class of device. Plus
all of the fallout in other callers to the CrushWrapper helpers, the
crushtool cli change, and cli test.
Signed-off-by: Sage Weil <sage@redhat.com>
Currently it only allows you to move buckets, which is annoying and much
less useful. To move an OSD you need to use create-or-move, which is
harder to use.
Fixes: http://tracker.ceph.com/issues/18587
Signed-off-by: Sage Weil <sage@redhat.com>
Reweight all items within a subtree. For example, you might reweigh tall
OSDs within a rack to a new value.
Signed-off-by: Sage Weil <sage@inktank.com>
Prevent creation of buckets of type 0 ('osd', 'device', etc.), as they
will confusing the mapping algorithm.
Signed-off-by: Sage Weil <sage@inktank.com>
The adjust method returns a count of adjusted items.
Add a test.
Fixes: #6382
Backport: dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
If we add an item that already exists in particular position, we should
update instead of inserting it; the CrushWrapper methods are not
idempotent.
Signed-off-by: Sage Weil <sage@inktank.com>