-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Milestone
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
CPU utilization
CLOUDSTACK VERSION
4.11+
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
CPU utilization metrics seems to be inconsistent with the actual CPU usage in the VM. The error seems to be generated from this getVMStat method in the LibvirtComputingResource class
/* get cpu utilization */
VmStats oldStats = null;
final Calendar now = Calendar.getInstance();
oldStats = _vmStats.get(vmName);
long elapsedTime = 0;
if (oldStats != null) {
elapsedTime = now.getTimeInMillis() - oldStats._timestamp.getTimeInMillis();
double utilization = (info.cpuTime - oldStats._usedTime) / ((double)elapsedTime * 1000000);
final NodeInfo node = conn.nodeInfo();
utilization = utilization / node.cpus;
if (utilization > 0) {
stats.setCPUUtilization(utilization * 100);
}
}
STEPS TO REPRODUCE
Run stress test on the VM with 100% cpu utilization then confirm VM Metric on the statistics tab
EXPECTED RESULTS
CPU utilization should be equally as high
ACTUAL RESULTS
CPU utilization is inconsistent i.e 8.4% (as shown)

