]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm.py: create RBD pool
authorNeha Ojha <nojha@redhat.com>
Tue, 5 Jan 2021 17:38:52 +0000 (17:38 +0000)
committerNeha Ojha <nojha@redhat.com>
Tue, 5 Jan 2021 21:32:41 +0000 (21:32 +0000)
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 <nojha@redhat.com>
qa/tasks/cephadm.py

index d1eaa64a0cd436f236f1e3941249049d6161ecf2..c2fa76dea24b5a8cfe212787bc8e0b3a351d3b9b 100644 (file)
@@ -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,