ISSUE TYPE
COMPONENT NAME
CLOUDSTACK VERSION
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)
ISSUE TYPE
COMPONENT NAME
CLOUDSTACK VERSION
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
getVMStatmethod in theLibvirtComputingResourceclassSTEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS