apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.11k stars 1.11k forks source link

Add cpu speed detection methods #9762

Open BartJM opened 1 month ago

BartJM commented 1 month ago

Description

This PR ads two additional methods to detect cpu speed on kvm hosts. This will improve the speed detection on AMD Epyc cpu's. For cpu's where the Ghz is in the model name no change will occur. For other cpu's the detected cpu speed ca change to the max Mhz of the cpu.

  1. A match on the CPU max MHz value from lscpu
  2. An additional sysfs file scaling_max_freq

Fixes: #6914

Types of changes

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

How Has This Been Tested?

Tested on a kvm host with an AMD EPYC 7601 cpu.

On an kvm centos8 vm without the lscpu matches and neither file the agent still falls back on host capabilities.

sureshanaparti commented 1 month ago

@blueorangutan package

blueorangutan commented 1 month ago

@sureshanaparti 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.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 68.18182% with 7 lines in your changes missing coverage. Please review.

Project coverage is 15.78%. Comparing base (019f2c6) to head (78a981f).

Files with missing lines Patch % Lines
...org/apache/cloudstack/utils/linux/KVMHostInfo.java 68.18% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9762 +/- ## ========================================== Coverage 15.78% 15.78% - Complexity 12564 12565 +1 ========================================== Files 5627 5627 Lines 492250 492261 +11 Branches 61405 62190 +785 ========================================== + Hits 77710 77718 +8 - Misses 406066 406070 +4 + Partials 8474 8473 -1 ``` | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/9762/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/9762/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.04% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/9762/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.60% <68.18%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

blueorangutan commented 1 month ago

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11266

sureshanaparti commented 1 month ago

@blueorangutan test

blueorangutan commented 1 month ago

@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

blueorangutan commented 1 month ago

[SF] Trillian test result (tid-11619) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 61373 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9762-t11619-kvm-ol8.zip Smoke tests completed. 140 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_secure_vm_migration Error 134.25 test_vm_life_cycle.py
test_01_secure_vm_migration Error 134.25 test_vm_life_cycle.py
DaanHoogland commented 1 month ago

@DaanHoogland @BartJM looks like some unwanted commits were added to this PR, probably due to the force push in the main. @DaanHoogland, could you take a look on this?

@BartJM , you want to execute

git rebase --onto main c087de4adfe0db02802ec4fe0929a5b3d6dfba2a 0ceff7f5b4cfdd2b2f26591d933eb112d8cf2329

and force push (git push --force) your branch. or alternatively start a new branch and git cherry-pick 0ceff7f5b4cfdd2b2f26591d933eb112d8cf2329 on that new branch. Then rename it to replace the branch in this PR or start a new PR.

DaanHoogland commented 4 weeks ago

@blueorangutan package

blueorangutan commented 4 weeks ago

@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.

blueorangutan commented 4 weeks ago

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11458

DaanHoogland commented 4 weeks ago

@blueorangutan test

blueorangutan commented 4 weeks ago

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

blueorangutan commented 4 weeks ago

[SF] Trillian test result (tid-11714) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 59169 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9762-t11714-kvm-ol8.zip Smoke tests completed. 141 look OK, 0 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
blueorangutan commented 1 day ago

[SF] Trillian Build Failed (tid-11797)

weizhouapache commented 1 day ago

@blueorangutan test ubuntu24 kvm-ubuntu24

blueorangutan commented 1 day ago

@weizhouapache a [SL] Trillian-Jenkins test job (ubuntu24 mgmt + kvm-ubuntu24) has been kicked to run smoke tests

blueorangutan commented 1 day ago

[SF] Trillian Build Failed (tid-11798)

blueorangutan commented 1 day ago

[SF] Trillian Build Failed (tid-11799)

blueorangutan commented 16 hours ago

[SF] Trillian test result (tid-11801) Environment: kvm-ubuntu22 (x2), Advanced Networking with Mgmt server u22 Total time taken: 57205 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9762-t11801-kvm-ubuntu22.zip Smoke tests completed. 139 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestClusterDRS>:setup Error 0.00 test_cluster_drs.py
test_hostha_enable_ha_when_host_disabled Error 3.01 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 302.14 test_hostha_kvm.py