Repository navigation
Open
Copy link
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
Prometheus Exporter
API
CLOUDSTACK VERSION
4.17.0
4.18.0
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
When CPU overcommit factor is changed, the prometheus exporter metric "cloudstack_host_cpu_usage_mhz_total" as well as API response of listHosts (cpuused field) seems to be multiplied to the new overcommit factor.
The actual "used" metrics should not be affected by overcommit factor. Overcommit factor should only virtually increase the capacity the node has, and not affecting the usage metric.
STEPS TO REPRODUCE
1. Empty out a hypervisors from VMs, VRs, systemvms etc. So there is no virtual machines running on it.
2. Pick a virtual machine to start on that hypervisor. Before starting, note the amount of CPU cores and CPU Mhz it has, e.g two cores 500Mhz each.
3. After you have started the test virtual machine on the test hypervisor, check the Prometheus cloudstack_host_cpu_usage_mhz_total{hostname=<your test hypervisor metric>}. It should show the CPU Mhz used on that hypervisor: cpu_number * cpu_mhz, e.g. 1000. This is the correct value.
4. Now change the cluster setting cpu.overprovisioning.factor to a new value, e.g. 4.
5. The cloudstack_host_cpu_usage_mhz_total{hostname=<your test hypervisor metric>} now shows different value, presumably calulated by the formula: cpu_number * cpu_mhz * (new_overprovisioning_factor - old_overprovisioning_factor)
6. If you stop and start the test VM, then the cloudstack_host_cpu_usage_mhz_total goes back to normal.
Same reproduce steps can be applied to the API response of listHosts call, field cpuused.
If you start a VM, then change overprovisioning factor, the field will contain incorrect value (especially if you put ridiculously high overprovisioning factor value, such as 1000).
EXPECTED RESULTS
The prometheus metric cloudstack_host_cpu_usage_mhz_total and API response of listHosts call (field cpuused) should not contain overprovisioning factor in their calculation as usage reports report on real usage.
ACTUAL RESULTS
The metric is reported without overprovisioning factor in its calculation when a VM starts, then gets distorted when you change overprovisioning factor.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsIn Testing
Activity
NuxRo commentedon Jun 7, 2023
@phsm The docs do say that you need to stop and start the VMs:
http://docs.cloudstack.apache.org/en/latest/adminguide/hosts.html?highlight=over-provisioning#setting-over-provisioning-factors
Only VMs deployed after the change are affected by the new setting. If you want VMs deployed before the change to adopt the new over-provisioning factor, you must stop and restart the VMs. When this is done, CloudStack recalculates or scales the used and reserved capacities based on the new over-provisioning factors, to ensure that CloudStack is correctly tracking the amount of free capacity.phsm commentedon Jun 9, 2023
@NuxRo Thanks for reviewing this bug report.
I think you've misunderstood what is the actual bug here.
The bug is that the overprovisioning factor is affecting the cloudstack_host_cpu_usage_mhz_total metric when you change the overprovisioning factor while it shouldn't.
(new_overprovision_factor - old overprovision_factor)So this is inconsistency in the behavior: usage metric is not affected by overprovisioning factor when you start a VM. When you change the overprovisioning factor, then the VM usage becomes affected by overprovisioning factor.
NuxRo commentedon Jun 12, 2023
@phsm Yes, it is a problem. This behaviour is unfortunate.
26 remaining items
RosiKyu commentedon Jan 28, 2026
@blueorangutan package
github-actions commentedon Aug 26, 2026
This issue is stale because it has been open for 120 days with no activity. It may be removed by administrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.
DaanHoogland commentedon Aug 26, 2026
@NuxRo , I am going to blame you for the lack of progress on this. Have a look at the last comments on the PR and suggest a way forwards.