qa/tasks/ceph: create osds before starting

This ensure they are in the OSDMap before the CRUSH
map, which avoids the OSD_ORPHAN health warning.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-06-21 13:52:42 -04:00
parent 0eed85515a
commit 2c8904506a

View File

@ -1100,6 +1100,37 @@ def run_daemon(ctx, config, type_):
continue
_, _, id_ = teuthology.split_role(role)
if type_ == 'osd':
datadir='/var/lib/ceph/osd/ceph-' + id_
osd_uuid = teuthology.get_file(
remote=remote,
path=datadir + '/fsid',
sudo=True,
).strip()
try:
remote.run(
args=[
'sudo',
'ceph',
'osd',
'new',
osd_uuid,
id_,
]
)
except:
# fallback to pre-luminous
remote.run(
args=[
'sudo',
'ceph',
'osd',
'create',
osd_uuid,
id_,
]
)
run_cmd = [
'sudo',
'adjust-ulimits',