]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph: create osds before starting
authorSage Weil <sage@redhat.com>
Wed, 21 Jun 2017 17:52:42 +0000 (13:52 -0400)
committerSage Weil <sage@redhat.com>
Thu, 22 Jun 2017 17:45:27 +0000 (13:45 -0400)
This ensure they are in the OSDMap before the CRUSH
map, which avoids the OSD_ORPHAN health warning.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/ceph.py

index f2c5ee75cf3f405708992b61596d5c2b671521e4..1a950f0870f8c5e6e5bb382543806ff75e5bc358 100644 (file)
@@ -1100,6 +1100,37 @@ def run_daemon(ctx, config, type_):
                 continue
             _, _, id_ = teuthology.split_role(role)
 
+            if type_ == 'osd':
+                datadir='/var/lib/ceph/osd/ceph-' + id_
+                osd_uuid = teuthology.get_file(
+                    remote=remote,
+                    path=datadir + '/fsid',
+                    sudo=True,
+                ).strip()
+                try:
+                    remote.run(
+                        args=[
+                            'sudo',
+                            'ceph',
+                            'osd',
+                            'new',
+                            osd_uuid,
+                            id_,
+                        ]
+                    )
+                except:
+                    # fallback to pre-luminous
+                    remote.run(
+                        args=[
+                            'sudo',
+                            'ceph',
+                            'osd',
+                            'create',
+                            osd_uuid,
+                            id_,
+                        ]
+                    )
+
             run_cmd = [
                 'sudo',
                 'adjust-ulimits',