From 3d447dbf2befc1fab7b8888eb670f9f2dfe5555a Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Mon, 26 Feb 2018 14:43:40 -0600 Subject: [PATCH] ceph-volume: lvm list now works with raw devices 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 --- src/ceph-volume/ceph_volume/devices/lvm/listing.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/devices/lvm/listing.py b/src/ceph-volume/ceph_volume/devices/lvm/listing.py index 6982f91bcdae2..6c13526eb1175 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/listing.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/listing.py @@ -119,11 +119,18 @@ class List(object): """ 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'] -- 2.39.5