ceph-volume: when --prepare is added to batch the OSDs are only prepared
authorAndrew Schoen <aschoen@redhat.com>
Mon, 15 Oct 2018 15:35:12 +0000 (10:35 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 25 Oct 2018 16:33:28 +0000 (11:33 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit abd238dc1f33252a43adc8b86efb3d3b4a076964)

src/ceph-volume/ceph_volume/devices/lvm/strategies/bluestore.py
src/ceph-volume/ceph_volume/devices/lvm/strategies/filestore.py

index 45834d72f853e1e1a6f54531ad887d1c262044db..92dc3a2e90a74dd8f62bb4d0ac60bc1a73771fa0 100644 (file)
@@ -4,6 +4,7 @@ from ceph_volume.util import disk, prepare
 from ceph_volume.api import lvm
 from . import validators
 from ceph_volume.devices.lvm.create import Create
+from ceph_volume.devices.lvm.prepare import Prepare
 from ceph_volume.util import templates
 from ceph_volume.exceptions import SizeAllocationError
 
@@ -134,7 +135,10 @@ class SingleType(object):
                 if self.args.crush_device_class:
                     command.extend(['--crush-device-class', self.args.crush_device_class])
 
-                Create(command).main()
+                if self.args.prepare:
+                    Prepare(command).main()
+                else:
+                    Create(command).main()
 
 
 class MixedType(object):
@@ -310,7 +314,10 @@ class MixedType(object):
             if self.args.crush_device_class:
                 command.extend(['--crush-device-class', self.args.crush_device_class])
 
-            Create(command).main()
+            if self.args.prepare:
+                Prepare(command).main()
+            else:
+                Create(command).main()
 
     def get_common_vg(self):
         # find all the vgs associated with the current device
index 28bfef1c4aee0ced7b5ab10592a7d74ca0d8f37d..b94cc6ea38d545fa9e488c7a84d74f829e2d60ae 100644 (file)
@@ -4,6 +4,7 @@ from ceph_volume.util import disk, prepare
 from ceph_volume.api import lvm
 from . import validators
 from ceph_volume.devices.lvm.create import Create
+from ceph_volume.devices.lvm.prepare import Prepare
 from ceph_volume.util import templates
 from ceph_volume.exceptions import SizeAllocationError
 
@@ -169,7 +170,10 @@ class SingleType(object):
             if self.args.crush_device_class:
                 command.extend(['--crush-device-class', self.args.crush_device_class])
 
-            Create(command).main()
+            if self.args.prepare:
+                Prepare(command).main()
+            else:
+                Create(command).main()
 
 
 class MixedType(object):
@@ -402,4 +406,7 @@ class MixedType(object):
             if self.args.crush_device_class:
                 command.extend(['--crush-device-class', self.args.crush_device_class])
 
-            Create(command).main()
+            if self.args.prepare:
+                Prepare(command).main()
+            else:
+                Create(command).main()