From: Sage Weil Date: Mon, 17 Jul 2017 19:22:47 +0000 (-0400) Subject: qa/tasks/ceph.py: create osds in order X-Git-Tag: v12.1.2~201^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c66da972df8104a964c94f527f0e25eec37dd16e;p=ceph.git qa/tasks/ceph.py: create osds in order We aren't passing id to legacy 'osd create', which means we have to go in order! Signed-off-by: Sage Weil --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 5318643d27a5..826567c64d82 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -1110,6 +1110,9 @@ def run_daemon(ctx, config, type_): if config.get('coverage') or config.get('valgrind') is not None: daemon_signal = 'term' + # create osds in order. (this only matters for pre-luminous, which might + # be hammer, which doesn't take an id_ argument to legacy 'osd create'). + osd_uuids = {} for remote, roles_for_host in daemons.remotes.iteritems(): is_type_ = teuthology.is_type(type_, cluster_name) for role in roles_for_host: @@ -1117,6 +1120,7 @@ def run_daemon(ctx, config, type_): continue _, _, id_ = teuthology.split_role(role) + if type_ == 'osd': datadir='/var/lib/ceph/osd/{cluster}-{id}'.format( cluster=cluster_name, id=id_) @@ -1125,29 +1129,40 @@ def run_daemon(ctx, config, type_): path=datadir + '/fsid', sudo=True, ).strip() - try: - remote.run( - args=[ - 'sudo', 'ceph', '--cluster', cluster_name, - 'osd', 'new', osd_uuid, id_, - ] - ) - except: - # fallback to pre-luminous (hammer or jewel) - remote.run( - args=[ - 'sudo', 'ceph', '--cluster', cluster_name, - 'osd', 'create', osd_uuid, - ] - ) - if config.get('add_osds_to_crush'): - remote.run( - args=[ - 'sudo', 'ceph', '--cluster', cluster_name, - 'osd', 'crush', 'create-or-move', 'osd.' + id_, - '1.0', 'host=localhost', 'root=default', - ] - ) + osd_uuids[id_] = osd_uuid + for osd_id in range(int(osd_uuids)): + id_ = str(osd_id) + osd_uuid = osd_uuids.get(id_) + try: + remote.run( + args=[ + 'sudo', 'ceph', '--cluster', cluster_name, + 'osd', 'new', osd_uuid, id_, + ] + ) + except: + # fallback to pre-luminous (hammer or jewel) + remote.run( + args=[ + 'sudo', 'ceph', '--cluster', cluster_name, + 'osd', 'create', osd_uuid, + ] + ) + if config.get('add_osds_to_crush'): + remote.run( + args=[ + 'sudo', 'ceph', '--cluster', cluster_name, + 'osd', 'crush', 'create-or-move', 'osd.' + id_, + '1.0', 'host=localhost', 'root=default', + ] + ) + + for remote, roles_for_host in daemons.remotes.iteritems(): + is_type_ = teuthology.is_type(type_, cluster_name) + for role in roles_for_host: + if not is_type_(role): + continue + _, _, id_ = teuthology.split_role(role) run_cmd = [ 'sudo',