From ffef64d046cb175732b4b97f898dabac5d83df10 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Thu, 14 May 2020 16:19:45 +0200 Subject: [PATCH] qa/cephadm: Add RGW Fixes: https://tracker.ceph.com/issues/43911 Signed-off-by: Sebastian Wagner --- qa/suites/rados/cephadm/smoke/fixed-2.yaml | 1 + qa/tasks/cephadm.py | 29 ++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/qa/suites/rados/cephadm/smoke/fixed-2.yaml b/qa/suites/rados/cephadm/smoke/fixed-2.yaml index 387053022ae..8a3ad9f58c3 100644 --- a/qa/suites/rados/cephadm/smoke/fixed-2.yaml +++ b/qa/suites/rados/cephadm/smoke/fixed-2.yaml @@ -7,6 +7,7 @@ roles: - osd.2 - osd.3 - client.0 + - ceph.rgw.realm.zone.a - node-exporter.a - alertmanager.a - - mon.b diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 0256cdbc247..f0babd38764 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -454,9 +454,13 @@ def ceph_bootstrap(ctx, config): #ctx.cluster.run(args=['sudo', 'systemctl', 'stop', 'ceph.target']) # so, stop them individually - for role in ctx.daemons.resolve_role_list(None, CEPH_ROLE_TYPES): + for role in ctx.daemons.resolve_role_list(None, CEPH_ROLE_TYPES, True): cluster, type_, id_ = teuthology.split_role(role) - ctx.daemons.get_daemon(type_, id_, cluster).stop() + try: + ctx.daemons.get_daemon(type_, id_, cluster).stop() + except Exception: + log.exception(f'Failed to stop "{role}"') + raise # clean up /etc/ceph ctx.cluster.run(args=[ @@ -717,12 +721,27 @@ def ceph_rgw(ctx, config): nodes[realmzone] = [] nodes[realmzone].append(remote.shortname + '=' + id_) daemons[role] = (remote, id_) + + for realmzone in nodes.keys(): + (realm, zone) = realmzone.split('.', 1) + + # TODO: those should be moved to mgr/cephadm + _shell(ctx, cluster_name, remote, + ['radosgw-admin', 'realm', 'create', '--rgw-realm', realm, '--default'] + ) + _shell(ctx, cluster_name, remote, + ['radosgw-admin', 'zonegroup', 'create', '--rgw-zonegroup=default', '--master', '--default'] + ) + _shell(ctx, cluster_name, remote, + ['radosgw-admin', 'zone', 'create', '--rgw-zonegroup=default', '--rgw-zone', zone, '--master', '--default'] + ) + for realmzone, nodes in nodes.items(): (realm, zone) = realmzone.split('.', 1) _shell(ctx, cluster_name, remote, [ - 'ceph', 'orch', 'apply', 'rgw', - realm, zone, - str(len(nodes)) + ';' + ';'.join(nodes)] + 'ceph', 'orch', 'apply', 'rgw', realm, zone, + '--placement', + str(len(nodes)) + ';' + ';'.join(nodes)] ) for role, i in daemons.items(): remote, id_ = i -- 2.39.5