]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Create rbd pool since it doesn't exist by default for luminous+ builds
authorVasu Kulkarni <vasu@redhat.com>
Mon, 21 Aug 2017 20:29:11 +0000 (13:29 -0700)
committerVasu Kulkarni <vasu@redhat.com>
Tue, 29 Aug 2017 21:09:53 +0000 (14:09 -0700)
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
teuthology/task/ceph_ansible.py

index e778b2850fc6e128948349c440518839b30c4d20..924e366743b1832a552f0d242df782ad42d2ac54 100644 (file)
@@ -279,6 +279,7 @@ class CephAnsible(Task):
         if re.search(r'all hosts have already failed', out.getvalue()):
             log.error("Failed during ceph-ansible execution")
             raise CephAnsibleError("Failed during ceph-ansible execution")
+        self._create_rbd_pool()
 
     def run_playbook(self):
         # setup ansible on first mon node
@@ -356,6 +357,7 @@ class CephAnsible(Task):
             self.wait_for_ceph_health()
         # for the teuthology workunits to work we
         # need to fix the permission on keyring to be readable by them
+        self._create_rbd_pool()
         self.fix_keyring_permission()
 
     def _copy_and_print_config(self):
@@ -381,6 +383,23 @@ class CephAnsible(Task):
             ceph_installer.run(args=('cat', 'ceph-ansible/site.yml'))
             ceph_installer.run(args=('cat', 'ceph-ansible/group_vars/all'))
 
+    def _create_rbd_pool(self):
+        mon_node = self.ceph_installer
+        cluster_name = 'ceph'
+        log.info('Creating RBD pool')
+        mon_node.run(
+            args=[
+                'sudo', 'ceph', '--cluster', cluster_name,
+                'osd', 'pool', 'create', 'rbd', '128', '128'],
+            check_status=False)
+        mon_node.run(
+            args=[
+                'sudo', 'ceph', '--cluster', cluster_name,
+                'osd', 'pool', 'application', 'enable',
+                'rbd', 'rbd', '--yes-i-really-mean-it'
+                ],
+            check_status=False)
+
     def fix_keyring_permission(self):
         clients_only = lambda role: role.startswith('client')
         for client in self.cluster.only(clients_only).remotes.iterkeys():