mirror of
https://github.com/ceph/ceph
synced 2024-12-17 17:05:42 +00:00
Merge pull request #12981 from liewegas/wip-crush-move-osd
mon/OSDMonitor: make 'osd crush move ...' work on osds Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
4bad4bd86a
@ -74,11 +74,16 @@ ceph osd crush rm foo
|
||||
ceph osd crush rm osd.$o2 host2
|
||||
ceph osd crush rm host2
|
||||
|
||||
ceph osd crush add-bucket foo host
|
||||
ceph osd crush move foo root=default rack=localrack
|
||||
|
||||
ceph osd crush create-or-move osd.$o1 1.0 root=default
|
||||
ceph osd crush move osd.$o1 host=foo
|
||||
ceph osd find osd.$o1 | grep host | grep foo
|
||||
|
||||
ceph osd crush rm osd.$o1
|
||||
ceph osd crush rm osd.$o2
|
||||
|
||||
ceph osd crush add-bucket foo host
|
||||
ceph osd crush move foo root=default rack=localrack
|
||||
ceph osd crush rm foo
|
||||
|
||||
# test reweight
|
||||
|
@ -5827,7 +5827,11 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
|
||||
int id = newcrush.get_item_id(name);
|
||||
|
||||
if (!newcrush.check_item_loc(g_ceph_context, id, loc, (int *)NULL)) {
|
||||
err = newcrush.move_bucket(g_ceph_context, id, loc);
|
||||
if (id >= 0) {
|
||||
err = newcrush.create_or_move_item(g_ceph_context, id, 0, name, loc);
|
||||
} else {
|
||||
err = newcrush.move_bucket(g_ceph_context, id, loc);
|
||||
}
|
||||
if (err >= 0) {
|
||||
ss << "moved item id " << id << " name '" << name << "' to location " << loc << " in crush map";
|
||||
pending_inc.crush.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user