-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: enforce the minimum cgroup cpu shares value to 2 #10221
base: 4.20
Are you sure you want to change the base?
Conversation
85f0879
to
c9ce12a
Compare
...ypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10221 +/- ##
============================================
- Coverage 16.13% 16.13% -0.01%
+ Complexity 12967 12966 -1
============================================
Files 5639 5639
Lines 494264 494265 +1
Branches 59899 59900 +1
============================================
- Hits 79760 79759 -1
- Misses 405684 405685 +1
- Partials 8820 8821 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: dahn <[email protected]>
9e981b4
to
f51aec9
Compare
...ypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
Outdated
Show resolved
Hide resolved
…/resource/LibvirtComputingResource.java Co-authored-by: dahn <[email protected]>
@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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12141 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Description
This PR ensures that the cpu shares value is never < 2 to be compatible with Libvirt versions before 9.1.0.
It turned out that the older libvirt versions, such as Ubuntu 22.04 libvirt 8.0.0 has the hardcoded range of allowed cpu shares values for both cgroupv1 and cgroupv2, which is 2-262144.
This range enforcement was removed in Libvirt 9.1.0, see: libvirt/libvirt@38af649
If a host has lots of cores, and the huge CPU overprovisioning factor is set, then the computed shares value can become 1.
In such case, the following exception is generated on the Cloudstack Agent during provisioning:
org.libvirt.LibvirtException: unsupported configuration: Value of cputune 'shares' must be in range [2, 262144]
We noticed it when tried to restart a Shared network with cleanup.
Steps to reproduce:
mount | grep -q cgroup2 && echo "yes, enabled"
should echo the output.com.cloud.exception.InsufficientServerCapacityException: No destination found for a deployment for VM instance
will be generated on the management server.org.libvirt.LibvirtException: unsupported configuration: Value of cputune 'shares' must be in range [2, 262144]
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested on Ubuntu 22.04 with Libvirt 8.0.0.
After the patch was applied, the error was gone, and the virtual router appeared after the restart with the cpushares value 2.
How did you try to break this feature and the system with this change?
The only effective change that this change does, is excluding the return value "1". It is highly unlikely to break anything.