Skip to content

constrained offerings should not have cpu speed of 0 - #12330

Closed
DaanHoogland wants to merge 2 commits into
apache:4.20from
shapeblue:zeroCpuCheck
Closed

constrained offerings should not have cpu speed of 0#12330
DaanHoogland wants to merge 2 commits into
apache:4.20from
shapeblue:zeroCpuCheck

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR adds a check for 0 cpuspeed on constraint offerings. A doc PR should follow to state that limitcpuuse should be set to zero to allow for unlimited cpu hogging.

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@daviftorres , I was given to understand this would interest you ;) (also have a good 2026)

@codecov

codecovBot commented Dec 23, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.23%. Comparing base (b394b5b) to head (8a35487).
⚠️ Report is 158 commits behind head on 4.20.

Files with missing linesPatch %Lines
.../cloud/configuration/ConfigurationManagerImpl.java0.00%39 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## 4.20 #12330 +/- ##
============================================
- Coverage 16.23% 16.23% -0.01% + Complexity 13377 13376 -1 
============================================
Files 5657 5657 Lines 498865 498878 +13 Branches 60545 60544 -1 ============================================
- Hits 80991 80988 -3 - Misses 408843 408856 +13 - Partials 9031 9034 +3 
FlagCoverage Δ
uitests4.00% <ø> (ø)
unittests17.09% <0.00%> (-0.01%)⬇️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHooglandDaanHoogland added this to the 4.20.3 milestone Dec 23, 2025
@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

@shwstppr , can you see if this makes sense, please?

@blueorangutan

Copy link
Copy Markdown

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

@shwstpprshwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@DaanHoogland problem is probably not just with creating offerings, but after it is used for a VM.
For an unconstrained offering, I was unable to change VM setting cpuSpeed to 0.

Image

For a constrained offering, I could add VM setting cpuSpeed to 0.

Image

@DaanHoogland

Copy link
Copy Markdown
ContributorAuthor

For a constrained offering, I could add VM setting cpuSpeed to 0.

Ok, I will add a guard there as well 🙇 .

@daviftorres

Copy link
Copy Markdown
Contributor

Currently, all constrained offerings have the CPU value set to 0. With this setting, KVM and VMware do not complain and do not throttle CPU performance.

However, all custom offerings require a positive CPU value; otherwise, they do not work.

I am not sure what the best approach is to address this issue, as my goal is to achieve the best possible performance per core, regardless of the underlying processor.

@daviftorres

Copy link
Copy Markdown
Contributor

Currently, all constrained offerings have the CPU value set to 0. With this setting, KVM and VMware do not complain and do not throttle CPU performance.

However, all custom offerings require a positive CPU value; otherwise, they do not work.

I am not sure what the best approach is to address this issue, as my goal is to achieve the best possible performance per core, regardless of the underlying processor.

Hey everyone, I’m not sure where we currently stand on this.

As I mentioned before, CPUs have both base and burst clock speeds. Using 0 as the clock value for the constrained offering is consistent with libvirt, where it represents an unlimited setting.

The limitation is that we can only configure based on CPU’s base clock, not the burst clock. This could unintentionally:

  1. Throttled performance of guest instances, or
  2. Prevented instances from starting if no host satisfies the allocation criteria.

For (1): I’m not completely sure this is happening, but when I run virsh dumpxml, I can see the clock value expressed in Hz. Its presence suggests that it is intended to be enforced, likely through throttling.

For (2): I’ve previously observed that when an offering specifies a clock speed that falls within the CPU’s burstable range but exceeds its baseline frequency, the instance fails to start.

When using 0 for the clock, dumpxml returns:

 <vcpu placement='static'>8</vcpu>

When using positive values, it returns:

 <vcpu placement='static'>24</vcpu>
<cputune>
<shares>966</shares>
<period>10000</period>
<quota>8700</quota>
</cputune>

Or

 <vcpu placement='static'>8</vcpu>
<cputune>
<shares>866</shares>
</cputune>

Am I miss understanding the issue?

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 120 days with no activity. It may be removed by administrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.

Sign up for freeto 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.

6 participants

@DaanHoogland@blueorangutan@daviftorres@shwstppr@abh1sar@RosiKyu