Skip to content

Commit

Permalink
ceph-volume: skip osd creation when already done
Browse files Browse the repository at this point in the history
When rerunning ceph-volume lvm create on a device already prepared and
activated, ceph-volume should skip the creation.

This is a regression introduced by bb4de1a

Fixes: https://tracker.ceph.com/issues/43981

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
  • Loading branch information
guits committed Feb 7, 2020
1 parent 06c9e64 commit 634a709
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ceph-volume/ceph_volume/devices/lvm/prepare.py
Expand Up @@ -239,6 +239,9 @@ def safe_prepare(self, args=None):
"""
if args is not None:
self.args = args
if api.is_ceph_device(self.get_lv(self.args.data)):
logger.info("device {} is already used".format(self.args.data))
raise RuntimeError("skipping {}, it is already prepared".format(self.args.data))
try:
self.prepare()
except Exception:
Expand Down

0 comments on commit 634a709

Please sign in to comment.