Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListHypervisors() fails in v1.4.0 #191

Open
priteau opened this issue May 28, 2021 · 3 comments
Open

ListHypervisors() fails in v1.4.0 #191

priteau opened this issue May 28, 2021 · 3 comments
Labels
bug Something isn't working documentation-needs-fixing
Milestone

Comments

@priteau
Copy link
Contributor

priteau commented May 28, 2021

With release v1.4.0 I am getting the following error:

Failed to collect metric for exporter: nova, error: failed to collect metric: running_vms, error: CPUInfo has unexpected type: <nil>" source="exporter.go:122

This impacts 9 metrics that are collected by this function. Since it worked fine in v1.3.0, I tracked it down to the following code:

                microversion, err := apiversions.Get(config.Client, "v2.1").Extract()
                if err == nil {
                                exporter.Client.Microversion = microversion.Version
                }

Removing this code fixes the error.

This is against a Wallaby deployment. Note the following change in Nova API for Wallaby:

2.88 (Maximum in Wallaby)
-------------------------

The following fields are no longer included in responses for the
``GET /os-hypervisors/detail`` and ``GET /os-hypervisors/{hypervisor_id}``
APIs:

- ``current_workload``
- ``cpu_info``
- ``vcpus``
- ``vcpus_used``
- ``free_disk_gb``
- ``local_gb``
- ``local_gb_used``
- ``disk_available_least``
- ``free_ram_mb``
- ``memory_mb``
- ``memory_mb_used``
- ``running_vms``

These fields were removed as the information they provided were frequently
misleading or outright wrong, and many can be better queried from placement.

In addition, the ``GET /os-hypervisors/statistics`` API, which provided a
summary view with just the fields listed above, has been removed entirely and
will now raise a HTTP 404 with microversion 2.88 or greater.

Finally, the ``GET /os-hypervisors/{hypervisor}/uptime`` API, which provided a
similar response to the ``GET /os-hypervisors/detail`` and ``GET
/os-hypervisors/{hypervisor_id}`` APIs but with an additional ``uptime`` field,
has been removed in favour of including this field in the primary ``GET
/os-hypervisors/detail`` and ``GET /os-hypervisors/{hypervisor_id}`` APIs.
@niedbalski
Copy link
Member

@alexeymyltsev do you have a wallaby environment to test this on?

@niedbalski niedbalski added bug Something isn't working documentation-needs-fixing labels Jun 30, 2021
@niedbalski niedbalski added this to the 1.4.1 milestone Jun 30, 2021
@alexeymyltsev
Copy link
Collaborator

alexeymyltsev commented Jun 30, 2021

@alexeymyltsev do you have a wallaby environment to test this on?

@niedbalski unfortunately we do not have Wallaby, for this moment we just on Victoria.
We have one release delay in our environment.

Looks like they move part of hypervisor's metrics to placement.

@alexeymyltsev
Copy link
Collaborator

alexeymyltsev commented Aug 22, 2021

Looks like with below code exporter will use only max version of microversion of Nova API.

	microversion, err := apiversions.Get(config.Client, "v2.1").Extract()
	if err == nil {
		exporter.Client.Microversion = microversion.Version
	}

I think will be better use variable from environment, if it is empty use max version.
OS_COMPUTE_API_VERSION should works.

priteau added a commit to stackhpc/kolla-ansible that referenced this issue Jun 16, 2022
Nova API version 2.88 removed details from the os-hypervisors API [1].
These details are queried by openstack-exporter for metrics such as
openstack_nova_running_vms. However, a change between v1.3.0 and v1.4.0
of the exporter caused it to use the latest API version, breaking
collection of these metrics [2].

Starting from v1.5.0 of the exporter, OS_COMPUTE_API_VERSION can be set
to configure the Nova API version to be used. Set it to 2.87 which is
the maximum version still providing this data.

[1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#maximum-in-wallaby
[2] openstack-exporter/openstack-exporter#191
[3] openstack-exporter/openstack-exporter#201

Change-Id: I7605a3f9f74effb29ecec3b28e4709fd5f7f8cd4
priteau added a commit to stackhpc/kolla-ansible that referenced this issue Jun 16, 2022
Nova API version 2.88 removed details from the os-hypervisors API [1].
These details are queried by openstack-exporter for metrics such as
openstack_nova_running_vms. However, a change between v1.3.0 and v1.4.0
of the exporter caused it to use the latest API version, breaking
collection of these metrics [2].

Starting from v1.5.0 of the exporter, OS_COMPUTE_API_VERSION can be set
to configure the Nova API version to be used. Set it to 2.79 (maximum in
Train), which also fixes an issue displaying the flavor ID [4].

[1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#maximum-in-wallaby
[2] openstack-exporter/openstack-exporter#191
[3] openstack-exporter/openstack-exporter#201
[4] openstack-exporter/openstack-exporter#220

Change-Id: I7605a3f9f74effb29ecec3b28e4709fd5f7f8cd4
priteau added a commit to stackhpc/kolla-ansible that referenced this issue Jun 16, 2022
Nova API version 2.88 removed details from the os-hypervisors API [1].
These details are queried by openstack-exporter for metrics such as
openstack_nova_running_vms. However, a change between v1.3.0 and v1.4.0
of the exporter caused it to use the latest API version, breaking
collection of these metrics [2].

Starting from v1.5.0 of the exporter, OS_COMPUTE_API_VERSION can be set
to configure the Nova API version to be used. Set it to 2.79 (maximum in
Train), which also fixes an issue displaying the flavor ID [4].

[1] https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#maximum-in-wallaby
[2] openstack-exporter/openstack-exporter#191
[3] openstack-exporter/openstack-exporter#201
[4] openstack-exporter/openstack-exporter#220

Change-Id: I7605a3f9f74effb29ecec3b28e4709fd5f7f8cd4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation-needs-fixing
Projects
None yet
Development

No branches or pull requests

3 participants