Cloudkitty keeps trying to use RegionOne

Bug #2067084 reported by Howard Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Unassigned

Bug Description

After installing on Rocky 9.3, Bobcat 28.2.0 on bare metal, the cloudkitty module insists on using a region name of RegionOne (which we do not have in our environment).

After installation was complete, the /etc/cloudkitty/cloudkitty.conf has the region_name set properly to our region name. And all the other modules use our region name without a problem.

Yet, cloudkitty keeps wanting to us RegionOne:

May 24 10:46:14 infra01 cloudkitty-processor[3407825]: 2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils [-] Unhandled exception: keystoneauth1.exceptions.catalog.EndpointNotFound: internalURL endpoint for metric service in RegionOne region not found
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils Traceback (most recent call last):
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/cotyledon/_utils.py", line 95, in exit_on_exception
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils yield
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/cotyledon/_service.py", line 139, in _run
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils self.run()
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/cloudkitty/orchestrator.py", line 604, in run
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils self.internal_run()
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/cloudkitty/orchestrator.py", line 612, in internal_run
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils self.load_scopes_to_process()
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/cloudkitty/orchestrator.py", line 663, in load_scopes_to_process
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils self.tenants = self.fetcher.get_tenants()
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/cloudkitty/fetcher/gnocchi.py", line 140, in get_tenants
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils resources_chunk = self._conn.resource.search(
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/gnocchiclient/v1/resource.py", line 186, in search
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils page = self._post(
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/gnocchiclient/v1/base.py", line 41, in _post
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils return self.client.api.post(*args, **kwargs)
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/keystoneauth1/adapter.py", line 401, in post
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils return self.request(url, 'POST', **kwargs)
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/gnocchiclient/client.py", line 35, in request
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils resp = super(SessionClient, self).request(url,
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/keystoneauth1/adapter.py", line 257, in request
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils return self.session.request(url, method, **kwargs)
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/keystoneauth1/session.py", line 803, in request
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils base_url = self.get_endpoint(auth, allow=allow,
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/keystoneauth1/session.py", line 1235, in get_endpoint
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils return auth.get_endpoint(self, **kwargs)
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/keystoneauth1/identity/base.py", line 372, in get_endpoint
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils endpoint_data = self.get_endpoint_data(
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/keystoneauth1/identity/base.py", line 272, in get_endpoint_data
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils endpoint_data = service_catalog.endpoint_data_for(
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils File "/openstack/venvs/cloudkitty-28.2.0/lib64/python3.9/site-packages/keystoneauth1/access/service_catalog.py", line 459, in endpoint_data_for
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils raise exceptions.EndpointNotFound(msg)
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils keystoneauth1.exceptions.catalog.EndpointNotFound: internalURL endpoint for metric service in RegionOne region not found
                                                       2024-05-24 10:46:14.595 3407825 ERROR cotyledon._utils

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to openstack-ansible (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/openstack-ansible/+/920430

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_cloudkitty (master)
Changed in openstack-ansible:
status: New → In Progress
Revision history for this message
Mariusz Karpiarz (mkarpiarz) wrote :

Howard,
"RegionOne" is indeed the default for both the Gnocchi collector and fetcher. See:

https://opendev.org/openstack/cloudkitty/src/commit/8a5319fd5de3f9f9c7b543936a3bb42fb02a62a8/cloudkitty/collector/gnocchi.py#L86
https://opendev.org/openstack/cloudkitty/src/commit/8a5319fd5de3f9f9c7b543936a3bb42fb02a62a8/cloudkitty/fetcher/gnocchi.py#L64

These can be changed to the value set for the `region_name` config parameter from section `[collector_gnocchi]`:

https://opendev.org/openstack/cloudkitty/src/commit/8a5319fd5de3f9f9c7b543936a3bb42fb02a62a8/cloudkitty/collector/gnocchi.py#L184
https://opendev.org/openstack/cloudkitty/src/commit/8a5319fd5de3f9f9c7b543936a3bb42fb02a62a8/cloudkitty/fetcher/gnocchi.py#L107

I think the proper fix would be to modify the source code of Cloudkitty so that `region_name` from `[keystone_authtoken]` is used first, with fallback to `region_name` from `[collector_gnocchi]` and the default if neither one is set.

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

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible/+/920430
Committed: https://opendev.org/openstack/openstack-ansible/commit/ea75d0bd952e51302abf24549782f1369599eda3
Submitter: "Zuul (22348)"
Branch: master

commit ea75d0bd952e51302abf24549782f1369599eda3
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sat May 25 10:29:15 2024 +0200

    Add gnocchi and ceilometer to cloudkity installation

    By default Cloudkitty leverages gnocchi as source of data. In order to
    make AIO deployment meaningfull, we need to ensure that it will be
    installed as well.
    Ceilometer is needed to provide data to Gnocchi, so that metering become
    possible.

    Related-Bug: #2067084
    Change-Id: I145f474e3c34fd4ccf447699ca1e6ca970f54600

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_cloudkitty (master)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_cloudkitty/+/920432
Committed: https://opendev.org/openstack/openstack-ansible-os_cloudkitty/commit/fae91db568637021438ffe436fb935a6735feb66
Submitter: "Zuul (22348)"
Branch: master

commit fae91db568637021438ffe436fb935a6735feb66
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sat May 25 11:50:25 2024 +0200

    Define region and interface for collector/fetcher

    It appears, that produced gnocchiclient does not respect region_name
    from the auth_section, thus it needs to be defined directly for the
    fetcher.

    We align collector for now with fetcher, to make change backportable.

    Closes-Bug: #2067084
    Change-Id: If3a37b6190449e18446e65ce3b8cb70cd9038c37

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_cloudkitty (stable/2023.2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_cloudkitty (stable/2023.1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible-os_cloudkitty (stable/2024.1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_cloudkitty (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_cloudkitty/+/921054
Committed: https://opendev.org/openstack/openstack-ansible-os_cloudkitty/commit/9d12b111d54210642684a4a0c25cdb264145923a
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 9d12b111d54210642684a4a0c25cdb264145923a
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sat May 25 11:50:25 2024 +0200

    Define region and interface for collector/fetcher

    It appears, that produced gnocchiclient does not respect region_name
    from the auth_section, thus it needs to be defined directly for the
    fetcher.

    We align collector for now with fetcher, to make change backportable.

    Closes-Bug: #2067084
    Change-Id: If3a37b6190449e18446e65ce3b8cb70cd9038c37
    (cherry picked from commit fae91db568637021438ffe436fb935a6735feb66)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_cloudkitty (stable/2024.1)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_cloudkitty/+/921285
Committed: https://opendev.org/openstack/openstack-ansible-os_cloudkitty/commit/ca6828641338b18a8dbcff4c85758adf82ce7c2d
Submitter: "Zuul (22348)"
Branch: stable/2024.1

commit ca6828641338b18a8dbcff4c85758adf82ce7c2d
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sat May 25 11:50:25 2024 +0200

    Define region and interface for collector/fetcher

    It appears, that produced gnocchiclient does not respect region_name
    from the auth_section, thus it needs to be defined directly for the
    fetcher.

    We align collector for now with fetcher, to make change backportable.

    Closes-Bug: #2067084
    Change-Id: If3a37b6190449e18446e65ce3b8cb70cd9038c37
    (cherry picked from commit fae91db568637021438ffe436fb935a6735feb66)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible-os_cloudkitty (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/openstack-ansible-os_cloudkitty/+/921055
Committed: https://opendev.org/openstack/openstack-ansible-os_cloudkitty/commit/bd1a8ea8d7926c4f4abe48476f307f31296fa706
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit bd1a8ea8d7926c4f4abe48476f307f31296fa706
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sat May 25 11:50:25 2024 +0200

    Define region and interface for collector/fetcher

    It appears, that produced gnocchiclient does not respect region_name
    from the auth_section, thus it needs to be defined directly for the
    fetcher.

    We align collector for now with fetcher, to make change backportable.

    Closes-Bug: #2067084
    Change-Id: If3a37b6190449e18446e65ce3b8cb70cd9038c37
    (cherry picked from commit fae91db568637021438ffe436fb935a6735feb66)

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.