From ac84aaaf9c20c7cb524e498410dd0485389aac63 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 7 Mar 2019 11:10:19 -0600 Subject: [PATCH] ceph-volume: update docs and help menu for `simple scan` Signed-off-by: Andrew Schoen (cherry picked from commit f7943ef6007fb05d83602bc22cbacf3bb67d8625) --- doc/ceph-volume/simple/scan.rst | 11 +++++++++++ doc/man/8/ceph-volume.rst | 6 +++++- src/ceph-volume/ceph_volume/devices/simple/scan.py | 12 +++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/doc/ceph-volume/simple/scan.rst b/doc/ceph-volume/simple/scan.rst index 320fee8fb4535..2749b14b64ac7 100644 --- a/doc/ceph-volume/simple/scan.rst +++ b/doc/ceph-volume/simple/scan.rst @@ -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 @@ -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 diff --git a/doc/man/8/ceph-volume.rst b/doc/man/8/ceph-volume.rst index 9ad5a5237af2d..5b1035ef748f1 100644 --- a/doc/man/8/ceph-volume.rst +++ b/doc/man/8/ceph-volume.rst @@ -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 @@ -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: * Actual data partition or a path to the running OSD diff --git a/src/ceph-volume/ceph_volume/devices/simple/scan.py b/src/ceph-volume/ceph_volume/devices/simple/scan.py index cc9f6faad4502..78a1493bd6094 100644 --- a/src/ceph-volume/ceph_volume/devices/simple/scan.py +++ b/src/ceph-volume/ceph_volume/devices/simple/scan.py @@ -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 @@ -284,7 +284,7 @@ class Scan(object): 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 @@ -299,13 +299,19 @@ class Scan(object): /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', -- 2.39.5