Repository navigation
Closed
Description
ISSUE TYPE
- Improvement Request
COMPONENT NAME
agent
CLOUDSTACK VERSION
4.15.2.0
CONFIGURATION
N/A
OS / ENVIRONMENT
CentOS 8/Rocky 8
SUMMARY
CPU capability detection error.
Because cloudstack-agent detected CPU is running at low frequency,
Not the CPU Maximum frequency.
When start VM will show "Cannot deploy the VM to specified host 21; host has cpu capability? false, host has capacity? true"
While I override value in database, it works fine.
But restart cloudstack-agent will be override by new detect low frequency.
$mysql
update host set speed = 2660 where id = 21;
STEPS TO REPRODUCE
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU E5640 @ 2.67GHz
stepping : 2
microcode : 0x1f
cpu MHz : 1595.704
cache size : 12288 KB
physical id : 1
siblings : 8
core id : 0
cpu cores : 4
apicid : 32
initial apicid : 32
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida arat flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 5320.07
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
EXPECTED RESULTS
cpu frequency * core * cpu.overprovisioning.factor = CPU Total
2.66 GHz * 16 * 32 = 1361.92 GHz
ACTUAL RESULTS
cpu frequency * core * cpu.overprovisioning.factor = CPU Total
1595.704 MHz * 16 * 32 = 817 GHz

Activity
yadvr commentedon Sep 22, 2021
cc @nvazquez @sureshanaparti pl triage, @davidjumani
davidjumani commentedon Sep 23, 2021
This could be OS related, in the env I've tested, the CPU Mhz matches the CPU Max frequency
Also, Cloudstack fetches the CPU speed from libvirt
https://github.com/apache/cloudstack/blob/main/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java#L93
leolleeooleo commentedon Sep 23, 2021
The file /proc/cpuinfo in CentOS 7 was Max frequency,
CentOS 8 and Rocky 8 are not always Max frequency, depend on idle or busy.
I get the log from here
https://github.com/apache/cloudstack/blob/4.15.2.0/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java#L85
And I had try (CentOS 7, CentOS 8, Rocky 8 are same)
and this only on Dell PowerEdge R410 and R610, others hardware are fine.
Director tree on Rocky 8 (Dell PowerEdge R410)
[-]CPU frequency detection not maxmum on Rocky 8[/-][+]CPU frequency detection not maximum on Rocky 8[/+]leolleeooleo commentedon Sep 23, 2021
On CentOS 7
On Rocky 8
davidjumani commentedon Sep 23, 2021
When it is unable to find the
cpuinfo_max_freqfile, it falls back on the data reported by libvirt.It looks like a non cloudstack issue since it only faces the problem on specific hardware and OS
As a workaround we can look into a different way of fetching the max cpu in the agent
leolleeooleo commentedon Sep 23, 2021
Here are I can get the maximum frequency
leolleeooleo commentedon Sep 23, 2021
Maybe I found the problem is.
Dell Server BIOS has Power Management Profile setting.
It is set to Active Power Controller (Dell designed, BIOS controlled processor frequency scaling).
I'll try to set it to OS Control (Operating system controlled processor frequency scaling).
leolleeooleo commentedon Sep 24, 2021
While I set Power Management Profile to OS Control, it can get maximum frequency.
And lscpu could not get maximum frequency while Power Management Profile is set to Active Power Controller.
davidjumani commentedon Sep 24, 2021
Thanks for the update @eolleeooleo @nvazquez I'll add a note about the power management profile in the docs
tetra12 commentedon Nov 8, 2021
Having the same issue on Ubuntu 20.04.3 with the latest Kernel 5.14.17
Probably, I'm having a hardware-kernel issue, so will downgrade a Kernel version a bit
My setup
I simply don't have that path at all!