Skip to content

Commit

Permalink
ceph-volume: update docs and help menu for simple scan
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit f7943ef)
  • Loading branch information
andrewschoen committed Mar 8, 2019
1 parent f68283e commit ac84aaa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
11 changes: 11 additions & 0 deletions doc/ceph-volume/simple/scan.rst
Expand Up @@ -9,6 +9,7 @@ PLAIN formats is fully supported.

The command has the ability to inspect a running OSD, by inspecting the
directory where the OSD data is stored, or by consuming the data partition.
The command can also scan all running OSDs if no path or device is provided.

Once scanned, information will (by default) persist the metadata as JSON in
a file in ``/etc/ceph/osd``. This ``JSON`` file will use the naming convention
Expand All @@ -31,6 +32,16 @@ the contents to ``stdout`` (no file will be written)::

.. _ceph-volume-simple-scan-directory:

Running OSDs scan
-----------------
Using this command without providing an OSD directory or device will scan the
directories of any currently running OSDs. If a running OSD was not created
by ceph-disk it will be ignored and not scanned.

To scan all running ceph-disk OSDs, the command would look like::

ceph-volume simple scan

Directory scan
--------------
The directory scan will capture OSD file contents from interesting files. There
Expand Down
6 changes: 5 additions & 1 deletion doc/man/8/ceph-volume.rst
Expand Up @@ -280,6 +280,10 @@ directory as well.

Optionally, the JSON blob can be sent to stdout for further inspection.

Usage on all running OSDs::

ceph-voume simple scan

Usage on data devices::

ceph-volume simple scan <data device>
Expand All @@ -295,7 +299,7 @@ Optional arguments:
* [--stdout] Send the JSON blob to stdout
* [--force] If the JSON file exists at destination, overwrite it

Required Positional arguments:
Optional Positional arguments:

* <DATA DEVICE or OSD DIR> Actual data partition or a path to the running OSD

Expand Down
12 changes: 9 additions & 3 deletions src/ceph-volume/ceph_volume/devices/simple/scan.py
Expand Up @@ -41,7 +41,7 @@ def parse_keyring(file_contents):

class Scan(object):

help = 'Capture metadata from an OSD data partition or directory'
help = 'Capture metadata from all running ceph-disk OSDs, OSD data partition or directory'

def __init__(self, argv):
self.argv = argv
Expand Down Expand Up @@ -284,7 +284,7 @@ def scan(self, args):

def main(self):
sub_command_help = dedent("""
Scan an OSD directory (or data device) for files and configurations
Scan running OSDs, an OSD directory (or data device) for files and configurations
that will allow to take over the management of the OSD.
Scanned OSDs will get their configurations stored in
Expand All @@ -299,13 +299,19 @@ def main(self):
/etc/ceph/osd/0-a9d50838-e823-43d6-b01f-2f8d0a77afc2.json
To a scan an existing, running, OSD:
To scan all running OSDs:
ceph-volume simple scan
To a scan a specific running OSD:
ceph-volume simple scan /var/lib/ceph/osd/{cluster}-{osd id}
And to scan a device (mounted or unmounted) that has OSD data in it, for example /dev/sda1
ceph-volume simple scan /dev/sda1
Scanning a device or directory that belongs to an OSD not created by ceph-disk will be ingored.
""")
parser = argparse.ArgumentParser(
prog='ceph-volume simple scan',
Expand Down

0 comments on commit ac84aaa

Please sign in to comment.