Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes required for teuthology's systemd support #18380

Merged
merged 5 commits into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 27 additions & 16 deletions qa/tasks/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from teuthology.orchestra.daemon import DaemonGroup

CEPH_ROLE_TYPES = ['mon', 'mgr', 'osd', 'mds', 'rgw']
DATA_PATH = '/var/lib/ceph/{type_}/{cluster}-{id_}'

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -610,10 +611,8 @@ def cluster(ctx, config):
for role in teuthology.cluster_roles_of_type(roles_for_host, 'mgr',
cluster_name):
_, _, id_ = teuthology.split_role(role)
mgr_dir = '/var/lib/ceph/mgr/{cluster}-{id}'.format(
cluster=cluster_name,
id=id_,
)
mgr_dir = DATA_PATH.format(
type_='mgr', cluster=cluster_name, id_=id_)
remote.run(
args=[
'sudo',
Expand All @@ -639,10 +638,8 @@ def cluster(ctx, config):
for role in teuthology.cluster_roles_of_type(roles_for_host, 'mds',
cluster_name):
_, _, id_ = teuthology.split_role(role)
mds_dir = '/var/lib/ceph/mds/{cluster}-{id}'.format(
cluster=cluster_name,
id=id_,
)
mds_dir = DATA_PATH.format(
type_='mds', cluster=cluster_name, id_=id_)
remote.run(
args=[
'sudo',
Expand All @@ -661,6 +658,9 @@ def cluster(ctx, config):
mds_dir + '/keyring',
],
)
remote.run(args=[
'sudo', 'chown', '-R', 'ceph:ceph', mds_dir
])

cclient.create_keyring(ctx, cluster_name)
log.info('Running mkfs on osd nodes...')
Expand All @@ -686,7 +686,8 @@ def cluster(ctx, config):

for role in teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name):
_, _, id_ = teuthology.split_role(role)
mnt_point = '/var/lib/ceph/osd/{cluster}-{id}'.format(cluster=cluster_name, id=id_)
mnt_point = DATA_PATH.format(
type_='osd', cluster=cluster_name, id_=id_)
remote.run(
args=[
'sudo',
Expand Down Expand Up @@ -790,6 +791,11 @@ def cluster(ctx, config):
'--monmap', monmap_path,
],
)
mnt_point = DATA_PATH.format(
type_='osd', cluster=cluster_name, id_=id_)
remote.run(args=[
'sudo', 'chown', '-R', 'ceph:ceph', mnt_point
])

log.info('Reading keys from all nodes...')
keys_fp = StringIO()
Expand All @@ -802,10 +808,10 @@ def cluster(ctx, config):
_, _, id_ = teuthology.split_role(role)
data = teuthology.get_file(
remote=remote,
path='/var/lib/ceph/{type}/{cluster}-{id}/keyring'.format(
type=type_,
id=id_,
cluster=cluster_name,
path=os.path.join(
DATA_PATH.format(
type_=type_, id_=id_, cluster=cluster_name),
'keyring',
),
sudo=True,
)
Expand Down Expand Up @@ -857,12 +863,14 @@ def cluster(ctx, config):
for remote, roles_for_host in mons.remotes.iteritems():
for role in teuthology.cluster_roles_of_type(roles_for_host, 'mon', cluster_name):
_, _, id_ = teuthology.split_role(role)
mnt_point = DATA_PATH.format(
type_='mon', id_=id_, cluster=cluster_name)
remote.run(
args=[
'sudo',
'mkdir',
'-p',
'/var/lib/ceph/mon/{cluster}-{id}'.format(id=id_, cluster=cluster_name),
mnt_point,
],
)
remote.run(
Expand All @@ -879,6 +887,9 @@ def cluster(ctx, config):
'--keyring', keyring_path,
],
)
remote.run(args=[
'sudo', 'chown', '-R', 'ceph:ceph', mnt_point
])

run.wait(
mons.run(
Expand Down Expand Up @@ -995,8 +1006,8 @@ def first_in_ceph_log(pattern, excludes):
is_mon = teuthology.is_type('mon', cluster_name)
if is_mon(role):
_, _, id_ = teuthology.split_role(role)
mon_dir = '/var/lib/ceph/mon/' + \
'{0}-{1}'.format(cluster_name, id_)
mon_dir = DATA_PATH.format(
type_='mon', id_=id_, cluster=cluster_name)
teuthology.pull_directory_tarball(
remote,
mon_dir,
Expand Down
3 changes: 3 additions & 0 deletions qa/tasks/cephfs/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,9 @@ def are_daemons_healthy(self):

:return:
"""
# First, check to see that processes haven't exited with an error code
for mds in self._ctx.daemons.iter_daemons_of_role('mds'):
mds.check_status()

active_count = 0
try:
Expand Down