Skip to content

Commit

Permalink
Merge pull request #9943 from ceph/wip-ceph-disk-systemd
Browse files Browse the repository at this point in the history
ceph-disk: do not activate device that is not ready

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
tchaikov committed Aug 26, 2016
2 parents 3c6d48b + 73a7a65 commit 577f027
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/ceph-disk/ceph_disk/main.py
Expand Up @@ -3335,14 +3335,21 @@ def main_activate(args):
else:
raise Error('%s is not a directory or block device' % args.path)

# exit with 0 if the journal device is not up, yet
# journal device will do the activation
osd_journal = '{path}/journal'.format(path=osd_data)
if os.path.islink(osd_journal) and not os.access(osd_journal, os.F_OK):
LOG.info("activate: Journal not present, not starting, yet")
return

if (not args.no_start_daemon and args.mark_init == 'none'):
command_check_call(
[
'ceph-osd',
'--cluster={cluster}'.format(cluster=cluster),
'--id={osd_id}'.format(osd_id=osd_id),
'--osd-data={path}'.format(path=osd_data),
'--osd-journal={path}/journal'.format(path=osd_data),
'--osd-journal={journal}'.format(journal=osd_journal),
],
)

Expand Down Expand Up @@ -3737,6 +3744,12 @@ def main_activate_space(name, args):
LOG.info('suppressed activate request on %s', path)
return

# warn and exit with 0 if the data device is not up, yet
# data device will do the activation
if not os.access(path, os.F_OK):
LOG.info("activate: OSD device not present, not starting, yet")
return

(cluster, osd_id) = mount_activate(
dev=path,
activate_key_template=args.activate_key_template,
Expand Down

0 comments on commit 577f027

Please sign in to comment.