list-disks doesn't correctly work when using partitions for osd backends
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceph OSD Charm |
Triaged
|
Wishlist
|
Unassigned | ||
charms.ceph |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
In full-nvme solution it makes sense to run multiple osds working on with the same nvme device.
IN order to achieve this it is necessary to use partitions when provisioning osds. However list-disks action doesn't list all possible partitions but rather shows disks only.
use-case:
pre-created 4 partitions on /dev/disk/
ubuntu@
nvme1n1
nvme1n1-part1
nvme1n1-part2
nvme1n1-part3
osd
osd-part1
osd-part2
osd-part3
osd-part4
sda
And osds are created on top of osd-partX partitions.
However list-disks only shows block devices themselves:
ubuntu@
unit-ceph-osd-0:
id: e5d80a12-
results:
blacklist: '[]'
disks: '[''/dev/sda'', ''/dev/nvme0n1'']'
non-pristine: '[''/dev/
status: completed
The culprit function is in charms.ceph lib/ceph/utils.py:
def unmounted_disks(): list_devices( DEVTYPE= 'disk') :
matched = True
continue
disks. append( device. device_ node) mounted( disk)]
"""List of unmounted block devices on the current host."""
disks = []
context = pyudev.Context()
for device in context.
if device['SUBSYSTEM'] == 'block':
matched = False
for block_type in [u'dm', u'loop', u'ram', u'nbd']:
if block_type in device.device_node:
if matched:
log("Found disks: {}".format(disks))
return [disk for disk in disks if not is_device_
It would either need to learn about partitions, or the calling function in ceph-osd would need to call another library that would add in partitions.