If you used a raw device with --data to create an OSD
you can now use 'lvm list' to get information about that OSD
using the raw device name like:
ceph-volume lvm list /dev/sda
fixes http://tracker.ceph.com/issues/23140
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
"""
Generate a report for a single device. This can be either a logical
volume in the form of vg/lv or a device with an absolute path like
- /dev/sda1
+ /dev/sda1 or /dev/sda
"""
lvs = api.Volumes()
report = {}
lv = api.get_lv_from_argument(device)
+
+ # check if there was a pv created with the
+ # name of device
+ pv = api.get_pv(pv_name=device)
+ if pv and not lv:
+ lv = api.get_lv(vg_name=pv.vg_name)
+
if lv:
try:
_id = lv.tags['ceph.osd_id']