From 86847daf4f975c48c6023c6261c442b3287a8aeb Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Mon, 15 Oct 2018 10:35:12 -0500 Subject: [PATCH] ceph-volume: when --prepare is added to batch the OSDs are only prepared Signed-off-by: Andrew Schoen (cherry picked from commit abd238dc1f33252a43adc8b86efb3d3b4a076964) --- .../ceph_volume/devices/lvm/strategies/bluestore.py | 11 +++++++++-- .../ceph_volume/devices/lvm/strategies/filestore.py | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ceph-volume/ceph_volume/devices/lvm/strategies/bluestore.py b/src/ceph-volume/ceph_volume/devices/lvm/strategies/bluestore.py index 45834d72f853e..92dc3a2e90a74 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/strategies/bluestore.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/strategies/bluestore.py @@ -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 diff --git a/src/ceph-volume/ceph_volume/devices/lvm/strategies/filestore.py b/src/ceph-volume/ceph_volume/devices/lvm/strategies/filestore.py index 28bfef1c4aee0..b94cc6ea38d54 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/strategies/filestore.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/strategies/filestore.py @@ -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() -- 2.39.5