Fix lscpu speed checking order - #12190
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12190 +/- ##
============================================
+ Coverage 17.61% 17.88% +0.26%
- Complexity 15647 16059 +412
============================================
Files 5913 5934 +21
Lines 530557 532088 +1531
Branches 64835 65065 +230
============================================
+ Hits 93456 95138 +1682
+ Misses 426589 426307 -282
- Partials 10512 10643 +131
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15943 |
|
Debian build failed, retrying that. |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14916)
|
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
f567935 to
e2b3a51
Compare
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
There was a problem hiding this comment.
Pull request overview
This PR fixes CPU speed detection on KVM hosts by reordering the priority of CPU frequency detection methods in the lscpu command. The change ensures that hosts report their maximum achievable CPU frequency rather than the base frequency from the model name.
- Swaps the order of CPU frequency detection: now tries "CPU max MHz" first, then falls back to model name frequency
- Preserves S390x architecture-specific handling with the model name frequency detection block
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16139 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15048)
|
|
@harikrishna-patnala @sureshanaparti , can you please review? |
|
[LL] Trillian Build Failed (tid-7170) |
|
@blueorangutan package |
|
@rajujith a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 16592 |
@nvazquez I've change it |
|
Sorry @guillemtp you have changed the targed branch but the code remains on top of the main branch, that is why all these conflicts are shown. Let me help changing again the target branch and will help with the next steps |
|
@guillemtp I have reverted the target PR back to main branch and only your changes are being displayed again. For rebasing to the branch 4.22 please consider the following steps, assuming the
After that, you can change again the target PR to 4.22 on Github. Please let me know if you have any questions |
|
@guillemtp I can help rebasing and getting the commit on top of the 4.22 branch, please let me know if I can proceed with this or you are happy doing it |
Yes @nvazquez, I've invited you to collaborate on the project. Sorry because I was some days off and I've cloudstack quite aside now. |
|
Thanks @guillemtp I have rebased the PR against 4.22. @blueorangutan package |
|
@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19176 |
nvazquez
left a comment
There was a problem hiding this comment.
LGTM - thanks @guillemtp - manually tested OK
KVM host:
root@nvs-kvm01:~# lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' | sed 's/GHz//g'
2.90
root@nvs-kvm01:~# lscpu | grep -i 'CPU max MHz' | head -n 1 | sed 's/^.*: //' | xargs
4800.0000
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |


Description
On KVM hosts, when agent checks the CPU speed it starts from lscpu before other mechanisms. It does a first check obtaining the CPU frequency from Model Name and if it's not specified in model name it takes from dynamic MHz option.
Dynamic MHz and frequency specified in model name can be different. Normally, dynamic MHz is bigger if the model name specifies. This means that we can have a registered host in CloudStack with a smaller frequency that it can achieve.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
The following host has been registered with a frequency of 2.4Ghz, which can achieve 3.4GHz. Here the commands that executes the
KVMHostInfo.java:How Has This Been Tested?
Overriding the lscpu command as the following and restarting the cloudstack agent shows the hosts in CloudStack control plane with the right frequency: