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
.. _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
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>
* [--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
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
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
/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',