]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/rebuild_mondb: use monmap to properly name the mons
authorSage Weil <sage@redhat.com>
Wed, 9 Jan 2019 22:05:40 +0000 (16:05 -0600)
committerSage Weil <sage@redhat.com>
Fri, 11 Jan 2019 22:10:14 +0000 (16:10 -0600)
We used to rely on the monmap bootstrap code to magically create a valid
monmap with named mons because our old-style ceph.conf had mon_addr
values in each mon.foo section.  Instead, just feed it a real monmap
from pre-destruction.

In practice, a user can manually generate this monmap, or rename the
mons after the fact with --inject-monmap, or whatever.  Out of scope
for this test, so we just do the simplest thing to make the rebuild test
work.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/suites/rados/singleton/all/rebuild-mondb.yaml
qa/tasks/rebuild_mondb.py

index 78d77c8811f04daf657132cd6d8dd82b708e4622..cc1c6809f12bd164ba7e6ae5aea2f672a32daf5e 100644 (file)
@@ -18,6 +18,7 @@ tasks:
       - no reply from
       - overall HEALTH_
       - \(MON_DOWN\)
+      - \(MGR_DOWN\)
       - \(OSDMAP_FLAGS\)
       - \(OSD_
       - \(PG_
index 739627b33aae1d31987c725bc22b9c4bba0b39ee..020487874ad789f3d5970fe93d190e7559bfb374 100644 (file)
@@ -131,8 +131,10 @@ def _rebuild_db(ctx, manager, cluster_name, mon, mon_id, keyring_path):
     mon.run(args=['sudo', '-u', 'ceph',
                   'CEPH_ARGS=--no-mon-config',
                   'ceph-monstore-tool', mon_store_dir,
-                  'rebuild', '--', '--keyring',
-                  keyring_path])
+                  'rebuild', '--',
+                  '--keyring', keyring_path,
+                  '--monmap', '/tmp/monmap',
+                  ])
 
 
 def _revive_mons(manager, mons, recovered, keyring_path):
@@ -156,7 +158,8 @@ def _revive_mons(manager, mons, recovered, keyring_path):
                         '--cluster', cluster,
                         '--mkfs',
                         '-i', m,
-                        '--keyring', keyring_path])
+                        '--keyring', keyring_path,
+                        '--monmap', '/tmp/monmap'])
             log.info('reviving mon.{0}'.format(m))
             manager.revive_mon(m)
             n_mons += 1
@@ -198,6 +201,10 @@ def task(ctx, config):
 
     first_mon = teuthology.get_first_mon(ctx, config)
     (mon,) = ctx.cluster.only(first_mon).remotes.iterkeys()
+
+    # stash a monmap for later
+    mon.run(args=['ceph', 'mon', 'getmap', '-o', '/tmp/monmap'])
+
     manager = ceph_manager.CephManager(
         mon,
         ctx=ctx,