Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: enumerate device names in a simple way #18453

merged 5 commits into from Nov 1, 2017


None yet
2 participants
Copy link

commented Oct 20, 2017

This adds a 'devices' metadata key that is a comma-separated list of device names (e.g., "sdc", "dm-1", "nvme0n1"). If there is a dm device in there, we also include all of the parent/consituent devices that it is built out of. For example, for my simple LV, I get

"devices": "dm-3,sdc",

This will simplify the mgr's efforts to correlate devices and osds. It will also be useful for the OSD code that queries SMART info.

What it doesn't do is distinguish between "primary" and "secondary" devices. So if you have a shared SSD with journals on it, all OSDs using it will include it in their list.


  • implement for FileStore
  • add a primary_device key too?

jcsp approved these changes Oct 31, 2017

Copy link

left a comment

Seems reasonable! I haven't read the LVM/DM code enough to know how strongly it guarantees to give you all the right links in /dev


This comment has been minimized.

Copy link

commented Oct 31, 2017

(does need a rebase too)

liewegas added some commits Oct 20, 2017

os/ObjectStore: add get_devices() method
The intent here is to return the set of hardware storage devices, as
identified by the "devname" (i.e., the directory name for the device in
/sys/block/).  For example, "sda", "nvme0n1", etc.

Signed-off-by: Sage Weil <>
os/bluestore/BlockDevice: add get_devname(), get_devices()
Enumerate device(s) that we are backed by.  It may be plural because of
DM, which might mask an underlying device, or because the dm device is
combining multiple other devices.

Signed-off-by: Sage Weil <>
osd: return rolled-up 'devices' list as part of metadata
Signed-off-by: Sage Weil <>
os/bluestore: implement get_devices()
Signed-off-by: Sage Weil <>
os/filestore: implement get_devices()
Signed-off-by: Sage Weil <>

@liewegas liewegas force-pushed the liewegas:wip-osd-devs branch from 86efd70 to e90eef1 Oct 31, 2017

@liewegas liewegas merged commit 1df0acc into ceph:master Nov 1, 2017

5 checks passed

Docs: build check OK - docs built
Signed-off-by all commits in this PR are signed
Unmodified Submodules submodules for project are unmodified
make check make check succeeded
make check (arm64) make check succeeded

@liewegas liewegas deleted the liewegas:wip-osd-devs branch Nov 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.