]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: skip osd creation when already done
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 5 Feb 2020 16:48:22 +0000 (17:48 +0100)
committerJan Fajerski <jfajerski@suse.com>
Wed, 12 Feb 2020 12:18:53 +0000 (13:18 +0100)
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 bb4de1a3fc238eaf9f717dc59c6bdf338ef6d657

Fixes: https://tracker.ceph.com/issues/43981
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 634a709b9c6802c5b12e2d45c2f43181b297adfb)

src/ceph-volume/ceph_volume/devices/lvm/prepare.py

index d46308df44fb44c557bddd978282a29702b90c64..c602a705fb921a78d7ddf0494d0fcf029b324523 100644 (file)
@@ -239,6 +239,9 @@ class Prepare(object):
         """
         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: