Left-over ceph.conf alternative

Bug #1778084 reported by Peter Sabaini
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Cinder Charm
Fix Released
Undecided
Chris MacNaughton
OpenStack Cinder-Ceph charm
Fix Released
Medium
Syed Mohammad Adnan Karim

Bug Description

When adding a ceph-mon rel to cinder, the charm installs ceph.conf with the alternatives system ( update-alternatives --install, called via cinder_utils.resource_map())

However upon rel departure that alternative is not cleaned up. That can cause issues if installing a cinder-ceph subord. This charm installs a ceph.conf alternative as well, but as it's at the same prio the alternatives system still points to the old ceph.conf.

James Page (james-page)
Changed in charm-cinder-ceph:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

What version of the charm is this on? The latest version should handle cleanup of the installed alternatives file: https://github.com/openstack/charm-cinder/blob/master/hooks/cinder_utils.py#L281

Changed in charm-cinder-ceph:
status: Triaged → Incomplete
Revision history for this message
Peter Sabaini (peter-sabaini) wrote :

These charms are at 17.02. ICBW, but I don't see a call to remove_alternative() in HEAD though?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack cinder-ceph charm because there has been no activity for 60 days.]

Changed in charm-cinder-ceph:
status: Incomplete → Expired
Revision history for this message
Xav Paice (xavpaice) wrote :

This was marked incomplete, could you clarify what information is needed?

Changed in charm-cinder-ceph:
status: Expired → New
James Page (james-page)
Changed in charm-cinder-ceph:
status: New → In Progress
James Page (james-page)
Changed in charm-cinder-ceph:
assignee: nobody → Syed Mohammad Adnan Karim (karimsye)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-cinder-ceph (master)

Fix proposed to branch: master
Review: https://review.openstack.org/620102

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-cinder-ceph (master)

Reviewed: https://review.openstack.org/620102
Committed: https://git.openstack.org/cgit/openstack/charm-cinder-ceph/commit/?id=18cbf7f6e1642d15d18c500c3e61f9106159e176
Submitter: Zuul
Branch: master

commit 18cbf7f6e1642d15d18c500c3e61f9106159e176
Author: Syed Mohammad Adnan Karim <email address hidden>
Date: Mon Nov 26 15:40:21 2018 +0000

    Update hook to remove old ceph.conf alternatives

    When adding ceph-mon relation to cinder, the charm installs ceph.conf
    with the update-alternatives via cinder_utils.resource_map().
    However when the relation is removed, the alternative isn't cleaned up.
    This can cause issues if installing a cinder-ceph subordinate charm.
    The cinder-ceph charm also installs a ceph.conf alternative that will
    point to the leftover ceph.conf installed by the ceph-mon charm.

    Added remove_alternative() in ceph-relation-broken hook to ensure
    that leftover ceph.conf alternatives is removed upon relation removal.

    Change-Id: I308e62a626f31eb8ef690a09035fe3908920ccc9
    Closes-Bug: 1778084

Changed in charm-cinder-ceph:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to charm-cinder-ceph (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/621595

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-cinder-ceph (master)

Reviewed: https://review.openstack.org/621595
Committed: https://git.openstack.org/cgit/openstack/charm-cinder-ceph/commit/?id=2378c424ee966f73e046499913605ce4b1e5e9d6
Submitter: Zuul
Branch: master

commit 2378c424ee966f73e046499913605ce4b1e5e9d6
Author: Syed Mohammad Adnan Karim <email address hidden>
Date: Sat Dec 1 00:50:54 2018 +0000

    Adds amulet test - ceph.conf alternatives removal

    Test checks for the removal of ceph.conf alternatives when ceph-mon
    relation is broken. If ceph.conf is not present when the relation is
    still joined, the test fails. If ceph.conf is not removed after the
    relation is broken, the test fails. The test will pass if an existing
    ceph.conf file is removed after the ceph-mon relation is broken.

    Change-Id: I3b348a58bd2e3ebbbecbd3bbb4307c490a0c4ea4
    Related-Bug: 1778084

Revision history for this message
Drew Freiberger (afreiberger) wrote :

Syed/James,

This needs to be pathced in charm-cinder as well. charm-cinder-ceph is the one that joins relation, not departs in this upgrade path from cinder->ceph to cinder->cinder-ceph->ceph.

Revision history for this message
Xav Paice (xavpaice) wrote :

Added field-critical. The move of relation from cinder to cinder-ceph, and the resulting empty ceph.conf, affects production environments where we've had to work around this with manual updates.

Revision history for this message
Xav Paice (xavpaice) wrote :

Manual workaround was to copy /var/lib/charm/cinder/ceph.conf to /var/lib/charm/cinder-ceph/ceph.conf plus fix alternatives to have only the one option:

update-alternatives --query ceph.conf

Name: ceph.conf
Link: /etc/ceph/ceph.conf
Status: auto
Best: /var/lib/charm/cinder-ceph/ceph.conf
Value: /var/lib/charm/cinder-ceph/ceph.conf

Alternative: /var/lib/charm/cinder-ceph/ceph.conf
Priority: 50

update-alternatives --config ceph.conf
There is only one alternative in link group ceph.conf (providing /etc/ceph/ceph.conf): /var/lib/charm/cinder-ceph/ceph.conf
Nothing to configure.

Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

This change exists at master, and has now been proposed for a backport in https://review.openstack.org/#/c/634867/

Changed in charm-cinder:
status: New → Fix Committed
Changed in charm-cinder:
assignee: nobody → Chris MacNaughton (chris.macnaughton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to charm-cinder (stable/18.11)

Reviewed: https://review.openstack.org/634867
Committed: https://git.openstack.org/cgit/openstack/charm-cinder/commit/?id=d2b9569d72db8b29e5e2439eda26f0ac05adb406
Submitter: Zuul
Branch: stable/18.11

commit d2b9569d72db8b29e5e2439eda26f0ac05adb406
Author: Syed Mohammad Adnan Karim <email address hidden>
Date: Mon Nov 26 16:30:22 2018 +0000

    Update hook to remove old ceph.conf alternatives

    When adding ceph-mon relation to cinder, the charm installs ceph.conf
    with the update-alternatives via cinder_utils.resource_map().
    However when the relation is removed, the alternative isn't cleaned up.
    This can cause issues if installing a cinder-ceph subordinate charm.
    The cinder-ceph charm also installs a ceph.conf alternative that will
    point to the leftover ceph.conf installed by the ceph-mon charm.

    Added remove_alternative() in ceph-relation-broken hook to ensure
    that leftover ceph.conf alternatives is removed upon relation removal.

    Change-Id: If9a8d460ee8209ef917fa55ec970379e9c741ec6
    Related-Bug: 1778084
    (cherry picked from commit e6a150c0d2894dadb870a4a356f1f9ab2336faa8)

Changed in charm-cinder:
status: Fix Committed → Fix Released
James Page (james-page)
Changed in charm-cinder-ceph:
milestone: none → 19.04
David Ames (thedac)
Changed in charm-cinder-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.