Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cpu speed detection methods #9762

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BartJM
Copy link
Contributor

@BartJM BartJM commented Oct 3, 2024

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

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

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

  • With normal agent start the cpu speed is detected as the expected 2200Mhz.
  • Removed the cpu max Mhz line from the lscpu output and restarted agent. The detected speed is still the expected 2200Mhz.

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

Added additional match for lscpu
Added additional file to check
Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

Copy link

codecov bot commented Oct 3, 2024

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 (c087de4) to head (0ceff7f).

Files with missing lines Patch % Lines
...org/apache/cloudstack/utils/linux/KVMHostInfo.java 68.18% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##               main    #9762     +/-   ##
===========================================
  Coverage     15.78%   15.78%             
- Complexity    12551    12553      +2     
===========================================
  Files          5625     5625             
  Lines        491993   492004     +11     
  Branches      59773    61546   +1773     
===========================================
+ Hits          77670    77679      +9     
- Misses       405864   405867      +3     
+ Partials       8459     8458      -1     
Flag Coverage Δ
uitests 4.03% <ø> (ø)
unittests 16.61% <68.18%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link

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

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Copy link
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, did not test it

@sureshanaparti
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hosts marked unavailable due to different CPU frequencies using host capabilities
5 participants