Hypervisor shows negative numbers after launching instances on baremetal nodes

Bug #1894771 reported by WuBing
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Unassigned

Bug Description

Testing with Train version with ironic driver.
Before launching instances on baremetal nodes, # nova hypervisor-show <uuid> command shows 0 for vcpus, memory and disk fields, which are set to zero in ironic.driver code.
This is still acceptable as baremetal resources are counted in resource class, however, after launching instance on the baremetal node, the vcpu/mem/disk fields appear to be negative in hypervisor-show details, and the negative numbers correlate with the flavor's vcpu/mem/disk fields.
[root@train ~(keystone_admin)]# nova hypervisor-show e12c91fb-4c73-406f-8b9e-b0ef3c9c829a
+-------------------------+--------------------------------------+
| Property | Value |
+-------------------------+--------------------------------------+
| cpu_info | {} |
| current_workload | 0 |
| disk_available_least | 0 |
| free_disk_gb | -100 |
| free_ram_mb | -16384 |
| host_ip | 192.168.10.111 |
| hypervisor_hostname | e12c91fb-4c73-406f-8b9e-b0ef3c9c829a |
| hypervisor_type | ironic |
| hypervisor_version | 1 |
| id | e12c91fb-4c73-406f-8b9e-b0ef3c9c829a |
| local_gb | 0 |
| local_gb_used | 100 |
| memory_mb | 0 |
| memory_mb_used | 16384 |
| running_vms | 1 |
| service_disabled_reason | None |
| service_host | train.ironic |
| service_id | 23464515-e938-47b1-807e-fb0e3d8250e3 |
| state | up |
| status | enabled |
| vcpus | 0 |
| vcpus_used | 8 |
+-------------------------+--------------------------------------+
The hypervisor detail does not affect the functions of baremetal instances, but is quite confusing.
Besides, nova quotas and usages are also affected by the baremetal flavor's vcpu/mem/disk fields, which maybe not able to describe the resources that the instance occupies.

Revision history for this message
Kaifeng Wang (kaifeng) wrote :

As far as I know, the root of this issue probably is that ironic node resources are consumed by hypervisor stat and resource provider tasks, we need to clear the VCPU/MEM/DISK resource for the resource provider so the resource class based scheduling makes sense, but it seems the same doesn't apply to the hypervisor stats.

Revision history for this message
Stephen Finucane (stephenfinucane) wrote :

This is expected behavior. The ironic driver does not report free disk, RAM and memory via the 'get_available_resource' driver API [1] which means the resource tracker is essentially subtracting usage from 0. That's considered okay though [2].

In general, the 'os-hypervisors' API, which the 'nova hypervisor-show' command uses, is considered very broken and will likely be removed in a future release. You should rely on placement for an authoritative view on resource consumption.

[1] https://github.com/openstack/nova/blob/e0f088c95d05e9cf32d4af4c7cfc20566b17f8e1/nova/virt/ironic/driver.py#L355-L357
[2] https://github.com/openstack/nova/blob/e0f088c95d05e9cf32d4af4c7cfc20566b17f8e1/nova/compute/resource_tracker.py#L1255

Changed in nova:
status: New → Won't Fix
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.