]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: remove "create" call from raw mode
authorSébastien Han <seb@redhat.com>
Fri, 24 Jan 2020 15:23:10 +0000 (16:23 +0100)
committerSébastien Han <seb@redhat.com>
Thu, 30 Jan 2020 08:35:19 +0000 (09:35 +0100)
This mode is intented to work when the cluster is running on Kubernetes
and OSDs are running on PVC.
So we always have a "prepare" pod and an "activate" pod.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit c7a2ecc59394a9eb323a19ff233a2e3dfe04a018)

src/ceph-volume/ceph_volume/devices/raw/create.py [deleted file]
src/ceph-volume/ceph_volume/devices/raw/main.py

diff --git a/src/ceph-volume/ceph_volume/devices/raw/create.py b/src/ceph-volume/ceph_volume/devices/raw/create.py
deleted file mode 100644 (file)
index fb633c7..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-from __future__ import print_function
-from textwrap import dedent
-import logging
-from ceph_volume.util import system
-from ceph_volume import decorators, terminal
-from .prepare import Prepare
-from .activate import Activate
-from .common import create_parser
-from ceph_volume.devices.lvm.common import rollback_osd
-
-logger = logging.getLogger(__name__)
-
-
-class Create(object):
-
-    help = 'Create a new (BlueStore) OSD on a raw device'
-
-    def __init__(self, argv):
-        self.argv = argv
-        self.args = None
-
-    @decorators.needs_root
-    def create(self, args):
-        if not args.osd_fsid:
-            args.osd_fsid = system.generate_uuid()
-        prepare_step = Prepare([])
-        prepare_step.safe_prepare(args)
-        osd_id = prepare_step.osd_id
-        try:
-            # we try this for activate only when 'creating' an OSD,
-            # because a rollback should not happen when doing normal
-            # activation. For example when starting an OSD, systemd
-            # will call activate, which would never need to be rolled
-            # back.
-            a = Activate([])
-            a.args = self.args
-            a.activate([args.data],
-                       tmpfs=not args.no_tmpfs,
-                       systemd=not args.no_systemd)
-        except Exception:
-            logger.exception('raw activate was unable to complete, while creating the OSD')
-            logger.info('will rollback OSD ID creation')
-            rollback_osd(args, osd_id)
-            raise
-        terminal.success("ceph-volume raw create successful for: %s" % args.data)
-
-    def main(self):
-        sub_command_help = dedent("""
-        Create an OSD by assigning an ID and FSID, registering them with the
-        cluster with an ID and FSID, formatting and mounting the volume, and
-        starting the OSD daemon. This is a convinience command that combines
-        the prepare and activate steps.
-
-        Encryption is not supported.
-
-        Separate DB and WAL devices are not supported.
-
-            ceph-volume raw create --data /dev/sdb
-
-        """)
-        parser = create_parser(
-            prog='ceph-volume raw create',
-            description=sub_command_help,
-        )
-        parser.add_argument(
-            '--no-systemd',
-            dest='no_systemd',
-            action='store_true',
-            help='Skip creating and enabling systemd units and starting OSD services',
-        )
-        if len(self.argv) == 0:
-            print(sub_command_help)
-            return
-        self.args = parser.parse_args(self.argv)
-        if not self.args.bluestore:
-            terminal.error('must specify --bluestore (currently the only supported backend)')
-            raise SystemExit(1)
-        if not self.args.no_systemd:
-            terminal.error('systemd support not yet implemented')
-            raise SystemExit(1)
-        self.create(self.args)
index 61286acad1e5cf12d2cc9a9a45b1a85c55491aae..efa2510909614c5c79cffdb21ec6b4e1498de7cc 100644 (file)
@@ -2,7 +2,6 @@ import argparse
 from textwrap import dedent
 from ceph_volume import terminal
 from . import list
-from . import create
 from . import prepare
 from . import activate
 
@@ -19,7 +18,6 @@ class Raw(object):
 
     mapper = {
         'list': list.List,
-        'create': create.Create,
         'prepare': prepare.Prepare,
         'activate': activate.Activate,
     }