Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luminous: ceph-volume: adds a --prepare flag to lvm batch #24759

Merged
merged 4 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/ceph-volume/lvm/batch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ devices in an efficient way?

The process is similar to :ref:`ceph-volume-lvm-create`, and will do the
preparation and activation at once, following the same workflow for each OSD.
However, If the ``--prepare`` flag is passed then only the prepare step is taken
and the OSDs are not activated.

All the features that ``ceph-volume lvm create`` supports, like ``dmcrypt``,
avoiding ``systemd`` units from starting, defining bluestore or filestore,
are supported. Any fine-grained option that may affect a single OSD is not
supported, for example: specifying where journals should be placed.




.. _ceph-volume-lvm-batch_bluestore:

``bluestore``
Expand Down
1 change: 1 addition & 0 deletions doc/man/8/ceph-volume.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Optional arguments:
* [--bluestore] Use the bluestore objectstore (default)
* [--filestore] Use the filestore objectstore
* [--yes] Skip the report and prompt to continue provisioning
* [--prepare] Only prepare OSDs, do not activate
* [--dmcrypt] Enable encryption for the underlying OSD devices
* [--crush-device-class] Define a CRUSH device class to assign the OSD to
* [--no-systemd] Do not enable or create any systemd units
Expand Down
5 changes: 5 additions & 0 deletions src/ceph-volume/ceph_volume/devices/lvm/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ def main(self):
type=int,
help='Override the "osd_journal_size" value, in megabytes'
)
parser.add_argument(
'--prepare',
action='store_true',
help='Only prepare all OSDs, do not activate',
)
args = parser.parse_args(self.argv)

if not args.devices:
Expand Down
11 changes: 9 additions & 2 deletions src/ceph-volume/ceph_volume/devices/lvm/strategies/bluestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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

Expand Down Expand Up @@ -134,7 +135,10 @@ def execute(self):
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):
Expand Down Expand Up @@ -310,7 +314,10 @@ def execute(self):
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
Expand Down
11 changes: 9 additions & 2 deletions src/ceph-volume/ceph_volume/devices/lvm/strategies/filestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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

Expand Down Expand Up @@ -169,7 +170,10 @@ def execute(self):
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):
Expand Down Expand Up @@ -402,4 +406,7 @@ def execute(self):
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()