Libvirt get_available_resource is reporting incorrect vcpus_used data for QEMU/LXC instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Stephen Finucane |
Bug Description
Currently if Nova is using the libvirt LXC driver, it is hardcoded to report 1 vCPU used on the host, regardless of how many containers are running.
Meanwhile for QEMU (aka TCG) guests, the guest.get_vcpu_info method is throwing an exception, since QEMU does not use a dedicated thread per vCPU currently. The effect is that on QEMU hosts, we're reporting 0 vCPUs used on the host regardless of how many guests are running
This causes the 'get_available_
eg with 2 instances running:
$ nova list
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| deee00d9-
| 3d160f7c-
+------
We're correctly recording that 2 vCPUs are used against the compute node
$ nova hypervisor-show 1 | grep vcpus
| vcpus | 12 |
| vcpus_used | 2 |
but when reporting the hypervisors view of available vCPUs the value never lowers from 12. eg it should be reporting 10, but it reports 12:
$ grep 'Hypervisor: free VCPUs' ../logs/n-cpu.log | tail
2016-11-03 11:17:24.003 19647 DEBUG nova.compute.
The resource tracker ignores the vcpus_used value reported by the hypervisor (which is arguably a bug in itself, because it causes it to incorrectly over-count QEMU CPU usage), but at least it means it is not affected by this libvirt bug - it merely causes mis-leading log messages to be emitted. None the less we should fix the libvirt reporting so that it is possible to have resource tracker honour this data in the future.
Changed in nova: | |
importance: | Undecided → Low |
Changed in nova: | |
assignee: | Daniel Berrange (berrange) → Stephen Finucane (stephenfinucane) |
Changed in nova: | |
assignee: | Stephen Finucane (stephenfinucane) → Michael Still (mikal) |
Changed in nova: | |
assignee: | Michael Still (mikal) → Stephen Finucane (stephenfinucane) |
Fix proposed to branch: master /review. openstack. org/393254
Review: https:/