From: xie xingguo Date: Wed, 25 Sep 2019 05:09:39 +0000 (+0800) Subject: mgr/balancer: enable pg_upmap cli for future use X-Git-Tag: v15.1.0~1414^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85efa8f99cd7c1253949fe3e4a93dcfca02fda91;p=ceph.git mgr/balancer: enable pg_upmap cli for future use Signed-off-by: xie xingguo --- diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 758aadd5721d..83507b8054dd 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -1250,11 +1250,23 @@ class Module(MgrModule): # upmap incdump = plan.inc.dump() - for pgid in incdump.get('old_pg_upmap_items', []): - self.log.info('ceph osd rm-pg-upmap-items %s', pgid) + for item in incdump.get('new_pg_upmap', []): + self.log.info('ceph osd pg-upmap %s mappings %s', item['pgid'], + item['osds']) result = CommandResult('foo') self.send_command(result, 'mon', '', json.dumps({ - 'prefix': 'osd rm-pg-upmap-items', + 'prefix': 'osd pg-upmap', + 'format': 'json', + 'pgid': item['pgid'], + 'id': item['osds'], + }), 'foo') + commands.append(result) + + for pgid in incdump.get('old_pg_upmap', []): + self.log.info('ceph osd rm-pg-upmap %s', pgid) + result = CommandResult('foo') + self.send_command(result, 'mon', '', json.dumps({ + 'prefix': 'osd rm-pg-upmap', 'format': 'json', 'pgid': pgid, }), 'foo') @@ -1275,6 +1287,16 @@ class Module(MgrModule): }), 'foo') commands.append(result) + for pgid in incdump.get('old_pg_upmap_items', []): + self.log.info('ceph osd rm-pg-upmap-items %s', pgid) + result = CommandResult('foo') + self.send_command(result, 'mon', '', json.dumps({ + 'prefix': 'osd rm-pg-upmap-items', + 'format': 'json', + 'pgid': pgid, + }), 'foo') + commands.append(result) + # wait for commands self.log.debug('commands %s' % commands) for result in commands: