list-disk action breaks with udev path based configuration

Bug #1831871 reported by Gábor Mészáros
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph OSD Charm
Expired
Undecided
Unassigned

Bug Description

If I have the following setup:
$ juju config ceph-osd osd-devices
/dev/disk/ceph/osd-sdc /dev/disk/ceph/osd-sdd
$ juju config ceph-osd-std osd-journal
/dev/disk/ceph/journal-sda /dev/disk/ceph/journal-sdb

created by a custom udev rule, the charm will find the journal devices non-pristine, as they have no partition mounted on those drives and they are listed with their udev names in the juju config.

Fix is simple, check the realpath of the journal drives during the list-disk action.
Something like
from os.path import realpath
    for dev in list(set(ceph.utils.unmounted_disks()) - set(realpath(d) for d in set(osd_journal))):
instead of
    for dev in list(set(ceph.utils.unmounted_disks()) - set(osd_journal)):

https://github.com/openstack/charm-ceph-osd/blob/master/actions/list_disks.py#L44

Tags: 4010
description: updated
Changed in charm-ceph-osd:
assignee: nobody → Gábor Mészáros (gabor.meszaros)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-ceph-osd (master)

Fix proposed to branch: master
Review: https://review.opendev.org/663587

Changed in charm-ceph-osd:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-ceph-osd (master)

Change abandoned by Gábor Mészáros (<email address hidden>) on branch: master
Review: https://review.opendev.org/663587

Changed in charm-ceph-osd:
assignee: Gábor Mészáros (gabor.meszaros) → nobody
status: In Progress → New
Revision history for this message
Luciano Lo Giudice (lmlogiudice) wrote :

Listing journal devices now uses the realpath instead of the raw path, so the fix proposed has been applied (although not tested). I unfortunately don't have an environment with a similar setup to try it out. Could you say if the issue is still present, Gábor ?

Changed in charm-ceph-osd:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Ceph OSD Charm because there has been no activity for 60 days.]

Changed in charm-ceph-osd:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.