From: Joshua Schmid Date: Thu, 30 Jan 2020 16:47:18 +0000 (+0100) Subject: mgr/osd_support: move docs to docs/mgr/osd_support.rst X-Git-Tag: v15.1.1~360^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c9b9e57967ce48eb7451b718e249f9b56acd87c3;p=ceph.git mgr/osd_support: move docs to docs/mgr/osd_support.rst Signed-off-by: Joshua Schmid --- diff --git a/doc/mgr/index.rst b/doc/mgr/index.rst index 159f95e3eec3..2a3116585c11 100644 --- a/doc/mgr/index.rst +++ b/doc/mgr/index.rst @@ -40,6 +40,7 @@ sensible. Telegraf module Telemetry module Iostat module + OSD Support module Crash module Insights module Orchestrator module diff --git a/doc/mgr/osd_support.rst b/doc/mgr/osd_support.rst new file mode 100644 index 000000000000..fb1037c2b74a --- /dev/null +++ b/doc/mgr/osd_support.rst @@ -0,0 +1,61 @@ +OSD Support Module +================== +The OSD Support module holds osd specific functionality that +is needed by different components like the orchestrators. + +In current scope: + +* osd draining + +Enabling +-------- +When an orchestrator is used this should be enabled as a dependency. +(*currently only valid for the cephadm orchestrator*) + +The *osd_support* module is manually enabled with:: + + ceph mgr module enable osd_support + +Commands +-------- + +Draining +######## + +This mode is for draining OSDs gracefully. `Draining` in this context means gracefully emptying out OSDs by setting their +weight to zero. An OSD is considered to be drained when no PGs are left. + +:: + + ceph osd drain $osd_id + +Takes a $osd_id and schedules it for draining. Since that process can take +quite some time, the operation will be executed in the background. To query the status +of the operation you can use: + +:: + + ceph osd drain status + +This gives you the status of all running operations in this format:: + + [{'osd_id': 0, 'pgs': 1234}, ..] + +If you wish to stop an OSD from being drained:: + + ceph osd drain stop [$osd_id] + +Stops all **scheduled** osd drain operations (not the operations that have been started already) +if no $osd_ids are given. If $osd_ids are present it only operates on them. +To stop and reset the weight of already started operations we need to save the initial weight +(see 'Ideas for improvement') + + +Ideas for improvement +---------------------- +- add health checks set_health_checks +- use objects to represent OSDs + - allows timestamps, trending information etc +- save osd drain state (at least the osd_ids in the mon store) + - resume after a mgr crash + - save the initial weight of a osd i.e. (set to initial weight on abort) diff --git a/src/pybind/mgr/osd_support/module.py b/src/pybind/mgr/osd_support/module.py index bbdebc16f3d8..eba8259abd6b 100644 --- a/src/pybind/mgr/osd_support/module.py +++ b/src/pybind/mgr/osd_support/module.py @@ -4,40 +4,6 @@ from threading import Event import json import errno -""" -A module that holds a variety of useful utility to deal with OSDs - -Draining OSDs: - -This module can be used to drain osds from the commandline: - -$ ceph osd drain $osd_ids ([$osd_ids]) - -You can monitor the progress with - -$ ceph osd drain status - -Gives you the status of scheduled and running osd drain operations - -[{'osd_id': 0, 'pgs': 1234}, ..] - -$ ceph osd drain stop ([$osd_ids]) - -Stops all !SCHEDULED! osd drain operations (not the operations that have been started already) -if no $osd_ids are give. If $osd_ids are present it only operates on them. -To stop and reset the weight of already started operations we need to save the initial weight -(see 'Ideas for improvement') - - -Ideas for improvement: -- add health checks set_health_checks -- use objects to represent OSDs - - allows timestamps, trending information etc -- save osd drain state (at least the osd_ids in the mon store) - - resume after a mgr crash - - save the initial weight of a osd i.e. (set to initial weight on abort) -""" - class OSDSupport(MgrModule): # these are CLI commands we implement @@ -59,14 +25,6 @@ class OSDSupport(MgrModule): }, ] - # These are module options we understand. These can be set with - # - # ceph config set global mgr/hello/ - # - # e.g., - # - # ceph config set global mgr/hello/place Earth - # MODULE_OPTIONS: List[dict] = [] # These are "native" Ceph options that this module cares about.