Charm directory created as OSD

Bug #1652175 reported by Billy Olsen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph OSD Charm
Fix Released
Medium
Billy Olsen
OpenStack Ceph Charm (Retired)
Fix Released
Medium
Unassigned
ceph (Juju Charms Collection)
Invalid
Medium
Unassigned
ceph-osd (Juju Charms Collection)
Invalid
Medium
Billy Olsen

Bug Description

For the osd-devices configuration, if there is an extra space in the list of devices (e.g. '/dev/sdb /dev/sdc /dev/sdd' with 2 spaces between /dev/sdb and /dev/sdc), the charm will turn the current working directory (e.g. the charm directory) into an OSD.

Now the charm directory itself is polluted AND the root devices for the machine is being used for space in the Ceph cluster. This is not good.

The reason for this that devices from the configuration are retrieved as follows:

    if config('osd-devices'):
        devices = [
            os.path.realpath(path)
            for path in config('osd-devices').split(' ')]

Note, splitting on space ' ' will return an empty string for the value between the two spaces. os.path.realpath('') evaluates to the current working directory.

One can avoid this by not specifying multiple spaces.

Tags: sts
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.openstack.org/414351

Changed in ceph-osd (Juju Charms Collection):
status: Triaged → In Progress
Changed in ceph (Juju Charms Collection):
status: New → Confirmed
status: Confirmed → Triaged
Liam Young (gnuoy)
Changed in ceph (Juju Charms Collection):
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-ceph-osd (master)

Reviewed: https://review.openstack.org/414351
Committed: https://git.openstack.org/cgit/openstack/charm-ceph-osd/commit/?id=665ea2b6fc8d03dd22da4dd61e6061a650196448
Submitter: Jenkins
Branch: master

commit 665ea2b6fc8d03dd22da4dd61e6061a650196448
Author: Billy Olsen <email address hidden>
Date: Thu Dec 22 16:09:56 2016 -0700

    Skip osd-devices not absolute paths

    This change skips over any devices which does not start with a leading
    folder separator ('/'). Allowing such entries causes an OSD to be
    created out of the charm directory. This can be caused by something as
    innocuous as 2 spaces between devices. The result is that the root
    device is also running an OSD, which is undesirable.

    Change-Id: I0b5530dc4ec4306a9efedb090e583fb4e2089749
    Closes-Bug: 1652175

Changed in ceph-osd (Juju Charms Collection):
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-ceph:
importance: Undecided → Medium
status: New → Triaged
Changed in ceph (Juju Charms Collection):
status: Triaged → Invalid
Changed in charm-ceph-osd:
assignee: nobody → Billy Olsen (billy-olsen)
importance: Undecided → Medium
status: New → Fix Committed
Changed in ceph-osd (Juju Charms Collection):
status: Fix Committed → Invalid
James Page (james-page)
Changed in charm-ceph-osd:
milestone: none → 17.02
James Page (james-page)
Changed in charm-ceph-osd:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-ceph (master)

Reviewed: https://review.openstack.org/414353
Committed: https://git.openstack.org/cgit/openstack/charm-ceph/commit/?id=a631169edd21915a6aabe76aaead617ca8383d7d
Submitter: Jenkins
Branch: master

commit a631169edd21915a6aabe76aaead617ca8383d7d
Author: Billy Olsen <email address hidden>
Date: Thu Dec 22 17:13:07 2016 -0700

    Skip osd-devices not absolute paths

    This change skips over any devices which does not start with a leading
    folder separator ('/'). Allowing such entries causes an OSD to be
    created out of the charm directory. This can be caused by something as
    innocuous as 2 spaces between devices. The result is that the root
    device is also running an OSD, which is undesirable.

    Change-Id: I5b52096da0b6f100ae9835c339905585425b27ae
    Closes-Bug: 1652175

Changed in charm-ceph:
status: Triaged → Fix Committed
James Page (james-page)
Changed in charm-ceph:
milestone: none → 17.08
James Page (james-page)
Changed in charm-ceph:
status: Fix Committed → Fix Released
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.