Skip to content

Commit

Permalink
Merge pull request #18989 from ceph/wip-luminous-rm22154
Browse files Browse the repository at this point in the history
luminous: ceph-disk create deprecation warnings

Reviewed-by: Andrew Schoen <aschoen@redhat.com>
  • Loading branch information
andrewschoen committed Nov 20, 2017
2 parents 5a469c0 + 94839de commit 613634c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
27 changes: 27 additions & 0 deletions doc/ceph-volume/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@ that may have been deployed with ``ceph-disk``.
* :ref:`ceph-volume-lvm`
* :ref:`ceph-volume-simple`


Migrating
---------
Starting on Ceph version 12.2.2, ``ceph-disk`` is deprecated. Deprecation
warnings will show up that will link to this page. It is strongly suggested
that users start consuming ``ceph-volume``.

New deployments
^^^^^^^^^^^^^^^
For new deployments, :ref:`ceph-volume-lvm` is recommended, it can use any
logical volume as input for data OSDs, or it can setup a minimal/naive logical
volume from a device.

Existing OSDs
^^^^^^^^^^^^^
If the cluster has OSDs that were provisioned with ``ceph-disk``, then
``ceph-volume`` can take over the management of these with
:ref:`ceph-volume-simple`. A scan is done on the data device or OSD directory,
and ``ceph-disk`` is fully disabled.

Encrypted OSDs
^^^^^^^^^^^^^^
If using encryption with OSDs, there is currently no support in ``ceph-volume``
for this scenario (although support for this is coming soon). In this case, it
is OK to continue to use ``ceph-disk`` until ``ceph-volume`` fully supports it.
This page will be updated when that happens.

.. toctree::
:hidden:
:maxdepth: 3
Expand Down
29 changes: 28 additions & 1 deletion src/ceph-disk/ceph_disk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,23 @@
import grp
import textwrap
import glob
import warnings

CEPH_OSD_ONDISK_MAGIC = 'ceph osd volume v026'
CEPH_LOCKBOX_ONDISK_MAGIC = 'ceph lockbox volume v001'

KEY_MANAGEMENT_MODE_V1 = 'ceph-mon v1'

DEPRECATION_WARNING = """
*******************************************************************************
This tool is now deprecated in favor of ceph-volume.
It is recommended to use ceph-volume for OSD deployments. For details see:
http://docs.ceph.com/docs/master/ceph-volume/#migrating
*******************************************************************************
"""

PTYPE = {
'regular': {
'journal': {
Expand Down Expand Up @@ -5638,6 +5649,8 @@ def make_zap_parser(subparsers):


def main(argv):
# Deprecate from the very beginning
warnings.warn(DEPRECATION_WARNING)
args = parse_args(argv)

setup_logging(args.verbose, args.log_stdout)
Expand All @@ -5657,10 +5670,20 @@ def main(argv):
CEPH_PREF_GROUP = args.setgroup

if args.verbose:
args.func(args)
try:
args.func(args)
except Exception:
# warn on any exception when running with verbosity
warnings.warn(DEPRECATION_WARNING)
# but still raise the original issue
raise

else:
main_catch(args.func, args)

# if there aren't any errors, still log again at the very bottom
warnings.warn(DEPRECATION_WARNING)


def setup_logging(verbose, log_stdout):
loglevel = logging.WARNING
Expand All @@ -5687,6 +5710,8 @@ def main_catch(func, args):
func(args)

except Error as e:
# warn on generic 'error' exceptions
warnings.warn(DEPRECATION_WARNING)
raise SystemExit(
'{prog}: {msg}'.format(
prog=args.prog,
Expand All @@ -5695,6 +5720,8 @@ def main_catch(func, args):
)

except CephDiskException as error:
# warn on ceph-disk exceptions
warnings.warn(DEPRECATION_WARNING)
exc_name = error.__class__.__name__
raise SystemExit(
'{prog} {exc_name}: {msg}'.format(
Expand Down

0 comments on commit 613634c

Please sign in to comment.