From c18a5d2e1cfd2912e6b5c32b12f25cf028d9ef4e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 9 Jan 2019 16:05:40 -0600 Subject: [PATCH] qa/tasks/rebuild_mondb: use monmap to properly name the mons 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 --- qa/suites/rados/singleton/all/rebuild-mondb.yaml | 1 + qa/tasks/rebuild_mondb.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/qa/suites/rados/singleton/all/rebuild-mondb.yaml b/qa/suites/rados/singleton/all/rebuild-mondb.yaml index 78d77c8811f..cc1c6809f12 100644 --- a/qa/suites/rados/singleton/all/rebuild-mondb.yaml +++ b/qa/suites/rados/singleton/all/rebuild-mondb.yaml @@ -18,6 +18,7 @@ tasks: - no reply from - overall HEALTH_ - \(MON_DOWN\) + - \(MGR_DOWN\) - \(OSDMAP_FLAGS\) - \(OSD_ - \(PG_ diff --git a/qa/tasks/rebuild_mondb.py b/qa/tasks/rebuild_mondb.py index 739627b33aa..020487874ad 100644 --- a/qa/tasks/rebuild_mondb.py +++ b/qa/tasks/rebuild_mondb.py @@ -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,