Verify we have the expected behavior for creates and moves that
maintain bucket summation, both with and without the
osd_crush_update_weight_set option enabled.
Signed-off-by: Sage Weil <sage@redhat.com>
- Make the initial weight-set actually consistent (summing)
- Fix the intermediate state so that it reflects a correctly
maintained summation.
Signed-off-by: Sage Weil <sage@redhat.com>
This reverts a27fd9d25c and
b863883ca7.
Quote form Sébastien Han:
> IIRC at some point, we were able to create a device class from the CLI.
Now it seems that the device class gets created when at least one OSD
of a particular class starts.
In ceph-ansible, we create pools after the initial monitors are up and
we want to assign a device crush class on some of them.
That's not possible at the moment since there no device class available yet.
Also, someone might want to create its own device class.
Something as crazy as running Filestore with a tmpfs osd store and
might want to isolate them.
I know it's a very limited use case, but still, it could be desired.
See also https://www.spinics.net/lists/ceph-devel/msg41152.html
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
In 076a6abd80 I killed the 'class rename' command
and thought it was totally useless but I was wrong.
Consider the following user case:
(1) randomly choose some OSDs(e.g., from different hosts) and try to make them for private use only,
say, by grouping them into 'pool1'
(2) ceph osd crush set-device-class pool1 'OSDs from (1)'
(3) ceph osd crush rule create-replicated rule_for_pool1 default host pool1
(4) ceph osd pool rename pool1 pool2
(5) ceph osd crush class rename pool1 pool2
From the above user case, we need to safely change a pool name without worrying
any risk of data migration. That is why the 'osd crush class rename' command
is still needed here.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
If a class is no more referenced by any devices or crush rules,
it shall be considered as dead.
This patch makes Ceph automatically recycles those dead classes,
so user does not to explicitly call 'class rm', which is unsafe
and annoying.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
The current version is broken. E.g., it should only remove a class
which is never referenced by any device.
Since we now create new classes automatically, we shall automatically
recycle dead classes too. So this command is definitely unuseful.
(Actually it is weird that we keep 'class rm' without keeping the
corresponding 'class create' command).
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
/bin/bash is a Linuxism. Other operating systems install bash to
different paths. Use /usr/bin/env in shebangs to find bash.
Signed-off-by: Alan Somers <asomers@gmail.com>
If a device has already been bounded to a class,
do not allow to change its class silently.
Require user call rm-device-class first.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
A class can be considered as in-use only if it is referenced by
any of the existing crush rules.
The patch also makes the output more human readable. For example:
./bin/ceph osd crush rule create-replicated myrule default host ssd
./bin/ceph osd crush class rm ssd
Error EBUSY: class 'ssd' still referenced by crush_rule 'myrule'
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This patch solves the problem below:
./bin/ceph osd crush move osd.0 root=foo rack=foo-rack host=foo-host
moved item id 0 name 'osd.0' to location {host=foo-host,rack=foo-rack,root=foo} in crush map
./bin/ceph osd crush rule create-replicated foo-rule foo host ssd
Error EINVAL: root foo has no devices with class ssd
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
- stop running via make check
- add teuthology yamls to run them
- disable ceph_objecstore_tool.py for now (too slow for make check, and
we can't use vstart in teuthology via a package install)
- drop cephtool tests since those are already covered by other teuthology
tests
- leave a handful of (fast!) ceph-helpers tests for make check for minimal
integration tests.
Signed-off-by: Sage Weil <sage@redhat.com>