Skip to content

Commit

Permalink
ceph-disk: do not activate device that is not ready
Browse files Browse the repository at this point in the history
If the journal (or data) device is not ready when we are activating the
data (or journal) device, just print an info message and exit with 0 so
that the ceph-disk systemd service won't fail in this case.

Fixes: http://tracker.ceph.com/issues/15990
Signed-off-by: Boris Ranto <branto@redhat.com>
  • Loading branch information
b-ranto committed Jun 27, 2016
1 parent 2cd0475 commit 72ed75a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ceph-disk/ceph_disk/main.py
Expand Up @@ -3311,6 +3311,12 @@ 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
if not os.access('{path}/journal'.format(path=osd_data), 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(
[
Expand All @@ -3336,7 +3342,7 @@ def main_activate(args):

def main_activate_lockbox(args):
activate_lock.acquire() # noqa
try:
'try:
main_activate_lockbox_protected(args)
finally:
activate_lock.release() # noqa
Expand Down Expand Up @@ -3713,6 +3719,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_space: 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 72ed75a

Please sign in to comment.