Skip to content

Conversation

@bradh352
Copy link

Description

As per #11930 KVM's memory ballooning does not auto-inflate and auto-deflate without the Free Page Reporting and autodeflate attributes on the memballoon configuration.

This is a change similar to OpenStack's NOVA:
openstack/nova@cd401c5

Basically if memballooning is enabled for KVM, these features are also always enabled. Having memory ballooning on in cloudstack otherwise does nothing as there is no tooling to inflate or deflate the balloon.

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?

Not yet tested, hoping CI/CD runs through some self-tests, then I'll try a test deployment.

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

N/A

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 17.56%. Comparing base (8089d32) to head (f43cdf9).
⚠️ Report is 160 commits behind head on main.

Files with missing lines Patch % Lines
...om/cloud/hypervisor/kvm/resource/LibvirtVMDef.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11932      +/-   ##
============================================
+ Coverage     17.36%   17.56%   +0.20%     
- Complexity    15245    15541     +296     
============================================
  Files          5888     5909      +21     
  Lines        525831   529061    +3230     
  Branches      64183    64618     +435     
============================================
+ Hits          91298    92924    +1626     
- Misses       424227   425683    +1456     
- Partials      10306    10454     +148     
Flag Coverage Δ
uitests 3.58% <ø> (-0.05%) ⬇️
unittests 18.63% <75.00%> (+0.22%) ⬆️

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.

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

@bradh352
Copy link
Author

pretty sure the simulator failure is unrelated to my changes

@blueorangutan
Copy link

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

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm, not tested

thanks @bradh352

@DaanHoogland
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@DaanHoogland 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-14747)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 65004 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11932-t14747-kvm-ol8.zip
Smoke tests completed. 148 look OK, 0 have errors, 1 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
all_test_human_readable_logs Skipped --- test_human_readable_logs.py

@bradh352
Copy link
Author

@weizhouapache looks like the smoke test passed

@weizhouapache
Copy link
Member

@weizhouapache looks like the smoke test passed

good @bradh352
now let's wait someone to test it

@bradh352
Copy link
Author

@weizhouapache is there a package artifact generated by this I can download and use to test? I'm still getting familiar with cloudstack, I'd rather not figure out how to build .deb packages for it if I don't have to :)

@weizhouapache
Copy link
Member

@weizhouapache is there a package artifact generated by this I can download and use to test? I'm still getting familiar with cloudstack, I'd rather not figure out how to build .deb packages for it if I don't have to :)

we do not provide the packages publicly, as the cloudstack-management-xx.deb package is huge

Comment on lines +1343 to +1346
memBalloonBuilder.append("<memballoon model='" + memBalloonModel + "'");
/* Version integer format: major * 1,000,000 + minor * 1,000 + release.
* Require: libvirt 6.9.0, qemu 5.1.0 */
if (memBalloonModel != MemBalloonModel.NONE && s_qemuVersion >= 5001000 && s_libvirtVersion >= 6009000) {
Copy link
Member

Choose a reason for hiding this comment

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

@bradh352, thanks for the PR, code looks good. Just one minor suggestion, could you extract this comment into a method's Javadoc string? For instance:

/**
* Updates the parent on the {@code checkpointXml} to {@code snapshotParent}. If {@code snapshotParent} is null, removes the parent.
* @param checkpointXml the checkpoint XML to be updated
* @param snapshotParent the snapshot parent. Inform null if no parent.
* */
private void updateParent(String snapshotParent, Document checkpointXml, XPath xPath) throws XPathExpressionException {

@bernardodemarco
Copy link
Member

I'd rather not figure out how to build .deb packages for it if I don't have to :)

@bradh352, I personally use this DEB builder: https://github.com/scclouds/cloudstack-deb-builder.

By default, it does not populate the cloudstack-management DEB with the system VM template and, therefore, the resulting package is more lightweight. However, the ACS environment must have the correct system VM template configured before installing the PR's packages.

To build the packages, go to the Apache CloudStack source code root directory and execute:

docker run -v <code-path>:/mnt/build/cloudstack -v ~/.m2:/root/.m2 -e "USER_ID=$(id -u)" -e "USER_GID=$(id -g)" -e "ACS_BUILD_OPTS=-T <number-of-threads> -DskipTests" scclouds/cloudstack-deb-builder:ubuntu2004-jdk11-python3

Where:

  • <code-path> is the path of the Apache CloudStack source code directory; and,
  • <number-of-threads> is the number of threads that will be used to build the artifacts.

For example:

docker run -v ~/code/cloudstack:/mnt/build/cloudstack -v ~/.m2:/root/.m2 -e "USER_ID=$(id -u)" -e "USER_GID=$(id -g)" -e "ACS_BUILD_OPTS=-T 4 -DskipTests" scclouds/cloudstack-deb-builder:ubuntu2004-jdk11-python3

It may take a little bit longer for the first build process to finish, due to the download process of some dependencies. After it is finished, the DEB packages will be located inside the Apache CloudStack source code directory, at the /dist/debbuild/DEBS path.

Hope it helps!

@DaanHoogland DaanHoogland changed the base branch from main to 4.22 November 5, 2025 15:23
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.

5 participants