canonical / charm-openstack-service-checks

Collection of Nagios checks and other utilities that can be used to verify the operation of an OpenStack cluster
0 stars 2 forks source link

check_allocations doesn't work on Bionic #143

Closed sudeephb closed 6 months ago

sudeephb commented 6 months ago

Affects: Bionic

Workaround: Upgrade to Focal

Description: The /usr/local/bin/run_allocation_checks.py script, run by /etc/cron.d/osc_allocations, fails on Bionic, giving this traceback:

sudo -u nagios /usr/local/bin/run_allocation_checks.py

Traceback (most recent call last): File "/usr/local/bin/run_allocation_checks.py", line 220, in main() File "/usr/local/bin/run_allocation_checks.py", line 214, in main alerts = check_allocations(connection, placement_client) File "/usr/local/bin/run_allocation_checks.py", line 99, in check_allocations instances = get_instances(connection, placement_client) File "/usr/local/bin/run_allocation_checks.py", line 71, in get_instances nova_instances = get_nova_instances(connection) File "/usr/local/bin/run_allocation_checks.py", line 41, in get_nova_instances for vm in compute.servers(details=True, all_projects=True): File "/usr/lib/python3/dist-packages/openstack/resource.py", line 883, in list cls._query_mapping._validate(params, base_path=cls.base_path) File "/usr/lib/python3/dist-packages/openstack/resource.py", line 252, in _validate extra_data=invalid_keys) openstack.exceptions.InvalidResourceQuery: Invalid query params: all_projects

This appears to be an artifact related to the version of python3-openstacksdk which ships with Bionic, which I presently see as 0.11.3+repack-0ubuntu1.

As the o-s-c charm doesn't appear to have a charmed way of pulling packages from UCA, the workaround is to upgrade to Focal, which currently has version 0.46.0-0ubuntu1 of python3-openstacksdk and should not be affected by the issue.

Suggestion for fix: consider only rendering this check on Focal or newer, and adding an appropriate note in config.yaml re: this restriction.


Imported from Launchpad using lp2gh.

sudeephb commented 6 months ago

(by jneo8) Update information: The link to the openstacksdk connect function: https://github.com/openstack/openstacksdk/blob/8cdf409c3d6fc3639e85292c5692f92031b4a172/openstack/__init__.py#L25