From 4594ab9aa7476cb66e300a505b0c20ca57ca86be Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 18 Nov 2019 20:31:05 +0800 Subject: [PATCH] qa/workunits/cephtool/test.sh: set min_{bytes,pgs}_per_osd for reweight otherwise ceph-mgr will refuse to perform reweight Signed-off-by: Kefu Chai --- qa/workunits/cephtool/test.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index f2070617520..0733139117b 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -2461,6 +2461,13 @@ function test_mon_osd_misc() set -e + local old_bytes_per_osd=$(ceph config get mgr mon_reweight_min_bytes_per_osd) + local old_pgs_per_osd=$(ceph config get mgr mon_reweight_min_pgs_per_osd) + # otherwise ceph-mgr complains like: + # Error EDOM: Refusing to reweight: we only have 5372 kb used across all osds! + # Error EDOM: Refusing to reweight: we only have 20 PGs across 3 osds! + ceph config set mgr mon_reweight_min_bytes_per_osd 0 + ceph config set mgr mon_reweight_min_pgs_per_osd 0 ceph osd reweight-by-utilization 110 ceph osd reweight-by-utilization 110 .5 expect_false ceph osd reweight-by-utilization 110 0 @@ -2474,6 +2481,9 @@ function test_mon_osd_misc() ceph osd reweight-by-pg 110 rbd ceph osd reweight-by-pg 110 .5 rbd expect_false ceph osd reweight-by-pg 110 boguspoolasdfasdfasdf + # restore the setting + ceph config set mgr mon_reweight_min_bytes_per_osd $old_bytes_per_osd + ceph config set mgr mon_reweight_min_pgs_per_osd $old_pgs_per_osd } function test_admin_heap_profiler() -- 2.39.5