Project

General

Profile

Actions

Feature #23451

closed

show physical devices in ceph-volume list

Added by Darrell Enns about 6 years ago. Updated about 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Currently, "ceph-volume lvm list" does not display the physical devices associated with the OSD/LVM volume (even with "--format json"). It would be very useful to include this information, as an easy way for administrators to see the physical drives associated with an OSD.

Actions #1

Updated by Greg Farnum about 6 years ago

  • Project changed from Ceph to ceph-volume
Actions #2

Updated by Alfredo Deza about 6 years ago

  • Status changed from New to 4

This might be tricky to get right. It would make sense when a single LV is part of a single physical device, but this isn't always the case. You can have a logical volume created from bits and pieces of more than one device, and I am not sure how to report that in a way that makes sense.

Of course you can always rely on the LVM tooling to that for you.

Actions #3

Updated by Darrell Enns about 6 years ago

How about returning a list of the physical devices as an array in the json output? We already have the VG, so it should just be a matter of listing all PVs that are part of that VG.

Actions #4

Updated by Alfredo Deza about 6 years ago

This is how it is tricky :)

If a VG has 2 devices, say, /dev/sda1 and /dev/sdc1, a logical volume can be created just from /dev/sda1 and omit /dev/sdc1.

The correct thing to do is to ask LVM to provide the list of associated devices with the actual LV. This is not impossible to do, it is just a bit complicated.

Actions #5

Updated by Alfredo Deza about 6 years ago

  • Status changed from 4 to 12
Actions #6

Updated by Darrell Enns about 6 years ago

Ah, yes. I hadn't considered the case of an LV with extents that only use specific PVs rather than the entire VG.

The necessary data seems to all be in there in the "lvm fullreport --reportformat json" output. There are arrays called "pvseg" which map LVs to PVs.

- get all the pvseg array entries that have an lv_uuid matching the ceph volume in question
- from these pvseg entries, get all the unique pv_uuid values
- for each unique pv_uuid value, get the pv_name (device name) from the "pv" array

Does ceph-volume currently use the lvm json report? I'm not sure when that was introduced in LVM, so the only concern might be compatibility with older versions.

Actions #7

Updated by Alfredo Deza about 6 years ago

We don't use --reportformat=json because Xenial doesn't support it. But LVM is still providing everything we need with comma separated values.

I am sure we can find the info, it is just going to take a bit longer to implement since it isn't straightforward

Actions #8

Updated by Alfredo Deza about 6 years ago

  • Status changed from 12 to In Progress
Actions #9

Updated by Alfredo Deza about 6 years ago

  • Status changed from In Progress to Fix Under Review
Actions #10

Updated by Alfredo Deza about 6 years ago

merged commit 189192b into ceph:master

Actions #11

Updated by Alfredo Deza about 6 years ago

  • Status changed from Fix Under Review to Resolved

merged commit c2b0176 into ceph:luminous

Actions

Also available in: Atom PDF