Hypervisor shows negative numbers after launching instances on baremetal nodes
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-
+------
| Property | Value |
+------
| cpu_info | {} |
| current_workload | 0 |
| disk_available_
| free_disk_gb | -100 |
| free_ram_mb | -16384 |
| host_ip | 192.168.10.111 |
| hypervisor_hostname | e12c91fb-
| hypervisor_type | ironic |
| hypervisor_version | 1 |
| id | e12c91fb-
| local_gb | 0 |
| local_gb_used | 100 |
| memory_mb | 0 |
| memory_mb_used | 16384 |
| running_vms | 1 |
| service_
| service_host | train.ironic |
| service_id | 23464515-
| 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.
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.