Gnocchi's ceph pool name can't be changed

Bug #1918821 reported by Andre Ruiz on 2021-03-11
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gnocchi Charm
Medium
Billy Olsen
charms.openstack
Medium
Unassigned

Bug Description

I'm deploying a charmed openstack cloud that is using an external ceph cluster through ceph-proxy.

All pool names need to be changed because that ceph cluster will be shared with another already existing openstack that created the standard pool names.

From the usual services that use ceph as a backend, I could successfully change the pool names for 'cinder-ceph' and 'glance', because they have options 'rbd-pool-name' that allows me to do that. And even if I don't explicitly set that option, I can just name the application differently and the default ceph pool will the the app name.

But gnocchi does not seem to follow that pattern. It does not have an option to change the ceph pool name, and it also does not use the app name for the pool. I changed the app name from 'gnocchi' to 'gnocchi-cloud2' and it still creates a pool called 'gnocchi' (this was tested in a lab).

Looking deeper, I found this code in ./wheelhouse/charms.openstack/charms_openstack/plugins/classes.py:

        kwargs = {
            'name': self.name,
        }
        if bluestore_compression:
            kwargs.update(bluestore_compression)
        ceph_interface.create_replicated_pool(**kwargs)

This seems to be getting the pool name from the self.name which is set in the inherited class GnocchiCharmBase in lib/charm/openstack/gnocchi.py:

        class GnocchiCharmBase(charms_openstack.plugins.PolicydOverridePlugin,
                       charms_openstack.charm.HAOpenStackCharm,
                       charms_openstack.plugins.BaseOpenStackCephCharm):
        [...]
            # Internal name of charm
            service_name = name = 'gnocchi'

Seems like the name of the pool is static and there is not way to change that.

My questions:

- shouldn't the name of the charm instance be the application name instead of a static charm name?
- if the above is not true, shouldn't the create_pool code be using the application name instead of self.name?
- can this behavior be changed to use the app name in the pool cration or even better to have an option to set the pool name (or both)?
- in case all above is negative, is there any harm in having two tottaly different gnocchi installations sharing the same pool in ceph?

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

Also, there seems to be an inconsistency where in the config template, the application name is used:

templates/gnocchi.conf:

{% if options.storage_backend == 'ceph' and storage_ceph.key -%}
driver = ceph
ceph_pool = {{ options.application_name }} <-------- here
ceph_username = {{ options.application_name }}
ceph_secret = {{ storage_ceph.key }}
ceph_conffile = {{ options.ceph_config }}

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

Subscribed field-high. Not a blocker, but maybe it will be in a week.

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

Just updating expectations on this one, it will definitely block the deploy/delivery in a few (~4) days.

Any comment on the question about sharing the same pool for both gnocchis is appreciated as this would alleviate the issue.

Changed in charm-gnocchi:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Billy Olsen (billy-olsen) wrote :
Changed in charm-gnocchi:
status: Triaged → In Progress
assignee: nobody → Billy Olsen (billy-olsen)
Changed in charms.openstack:
status: New → In Progress
Changed in charms.openstack:
importance: Undecided → Medium
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :
Changed in charm-gnocchi:
status: In Progress → Fix Committed
Changed in charms.openstack:
status: In Progress → Fix Committed
Changed in charm-gnocchi:
milestone: none → 21.04
status: Fix Committed → Fix Released
Changed in charms.openstack:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers