From: Neha Ojha Date: Tue, 5 Jan 2021 17:38:52 +0000 (+0000) Subject: qa/tasks/cephadm.py: create RBD pool X-Git-Tag: v16.1.0~134^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=276a4fb8b097331de77ec165694442f21031c0cf;p=ceph.git qa/tasks/cephadm.py: create RBD pool The ceph task already does this and a bunch of tests rely on this pool being already present. Can be disabled by setting create_rbd_pool to False. Signed-off-by: Neha Ojha --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index d1eaa64a0cd4..c2fa76dea24b 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -1017,6 +1017,29 @@ def crush_setup(ctx, config): args=['ceph', 'osd', 'crush', 'tunables', profile]) yield +@contextlib.contextmanager +def create_rbd_pool(ctx, config): + cluster_name = config['cluster'] + log.info('Waiting for OSDs to come up') + teuthology.wait_until_osds_up( + ctx, + cluster=ctx.cluster, + remote=ctx.ceph[cluster_name].bootstrap_remote, + ceph_cluster=cluster_name, + ) + if config.get('create_rbd_pool', True): + log.info('Creating RBD pool') + _shell(ctx, cluster_name, ctx.ceph[cluster_name].bootstrap_remote, + args=['sudo', 'ceph', '--cluster', cluster_name, + 'osd', 'pool', 'create', 'rbd', '8']) + _shell(ctx, cluster_name, ctx.ceph[cluster_name].bootstrap_remote, + args=[ + 'sudo', 'ceph', '--cluster', cluster_name, + 'osd', 'pool', 'application', 'enable', + 'rbd', 'rbd', '--yes-i-really-mean-it' + ]) + yield + @contextlib.contextmanager def _bypass(): yield @@ -1224,6 +1247,7 @@ def task(ctx, config): lambda: ceph_monitoring('alertmanager', ctx=ctx, config=config), lambda: ceph_monitoring('grafana', ctx=ctx, config=config), lambda: ceph_clients(ctx=ctx, config=config), + lambda: create_rbd_pool(ctx=ctx, config=config), ): ctx.managers[cluster_name] = CephManager( ctx.ceph[cluster_name].bootstrap_remote,