Skip to content

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Sep 17, 2025

Description

Bundling all hypervisor SystemVM templates in release packages simplifies installs but inflates build time and pacakge size. This change enables downloading templates on demand when they’re not found after package installation. The download path is wired into both cloud-setup-management and the existing SystemVM template registration flow.
cloudstack-setup-management allows the argument --systemvm-templates to download the desired hypervisor system template during management server setup.

For air-gapped environments, a repository URL prefix can be provided to support air-gapped setups: pass --systemvm-templates-repository <URL-prefix> to cloudstack-setup-management, or set system.vm.templates.download.repository=<URL-prefix> in server.properties for post-setup registration. Currently, custom repository should mirror the file structure of the official repository, ie, <BASE_VERSION>/systemvmtemplate-<VERSION>-<ARCH>-<HYPERVISOR>.<FILE_EXTENSION>
If templates are already present (bundled or preseeded), behavior is unchanged and no download is attempted.

Documentation PR: apache/cloudstack-documentation#580

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?

@shwstppr shwstppr force-pushed the disjoint-systemvmtmpl branch from 5c41125 to df47ea1 Compare September 17, 2025 10:55
@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 62.50000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.57%. Comparing base (bfc4f60) to head (29cd184).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...om/cloud/upgrade/SystemVmTemplateRegistration.java 40.00% 4 Missing and 2 partials ⚠️
.../cloudstack/utils/server/ServerPropertiesUtil.java 72.72% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #11656   +/-   ##
=========================================
  Coverage     17.56%   17.57%           
- Complexity    15540    15546    +6     
=========================================
  Files          5909     5910    +1     
  Lines        529045   529088   +43     
  Branches      64615    64623    +8     
=========================================
+ Hits          92933    92962   +29     
- Misses       425657   425668   +11     
- Partials      10455    10458    +3     
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.63% <62.50%> (+<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.

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

…ration

Bundling all hypervisor SystemVM templates in release packages simplifies installs but inflates build time and artifact size. This change enables downloading templates on demand when they’re not found after package installation. The download path is wired into both cloud-setup-management and the existing SystemVM template registration flow.

For connected or mirrored environments, a repository URL prefix can be provided to support air-gapped setups: pass --systemvm-templates-repository <URL-prefix> to cloud-setup-management, or set system.vm.templates.download.repository=<URL-prefix> in server.properties for post-setup registration.

If templates are already present (bundled or preseeded), behavior is unchanged and no download is attempted.

Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr shwstppr force-pushed the disjoint-systemvmtmpl branch from df47ea1 to efdea06 Compare September 17, 2025 14:49
@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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
Copy link

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

Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr shwstppr requested a review from Copilot October 9, 2025 10:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances CloudStack's SystemVM template handling by enabling on-demand downloading of templates during setup and registration, reducing package size and build time. The implementation supports both regular and air-gapped environments through configurable repository URLs.

  • Adds on-demand SystemVM template downloading capability with checksum verification
  • Refactors template metadata handling to support custom download repositories
  • Implements centralized server properties utility for configuration management

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utils/src/main/java/org/apache/cloudstack/utils/server/ServerPropertiesUtil.java New utility class for centralized server.properties access with thread-safe caching
plugins/hypervisors/external/src/main/java/org/apache/cloudstack/hypervisor/external/provisioner/ExternalPathPayloadProvisioner.java Refactored to use new ServerPropertiesUtil instead of duplicated property loading logic
engine/schema/templateConfig.sh Enhanced template metadata generation with repository URL support and refactored template specification structure
engine/schema/src/test/java/com/cloud/upgrade/SystemVmTemplateRegistrationTest.java Updated test case to use VMware/arm64 combination instead of KVM/amd64
engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java Added support for custom download repository configuration and URL replacement logic
client/conf/server.properties.in Added configuration property for custom SystemVM template repository URL
client/bindir/cloud-setup-management.in Implemented comprehensive template download functionality with metadata parsing and checksum verification

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

shwstppr added a commit to shapeblue/cloudstack-documentation that referenced this pull request Oct 13, 2025
@blueorangutan
Copy link

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

@shwstppr
Copy link
Contributor Author

@blueorangutan newpackage

@blueorangutan
Copy link

@shwstppr 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
Copy link

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

@shwstppr
Copy link
Contributor Author

@blueorangutan newpackage

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with no systemVM templates. I'll keep you posted as I make progress.

@shwstppr shwstppr closed this Oct 27, 2025
@shwstppr shwstppr reopened this Oct 27, 2025
@blueorangutan
Copy link

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

Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr
Copy link
Contributor Author

@blueorangutan newpackage

@blueorangutan
Copy link

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with no systemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

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

@shwstppr
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@DaanHoogland DaanHoogland added this to the 4.23 milestone Oct 28, 2025
@blueorangutan
Copy link

[SF] Trillian test result (tid-14736)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 64859 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11656-t14736-kvm-ol8.zip
Smoke tests completed. 145 look OK, 2 have errors, 2 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_01_redundant_vpc_site2site_vpn Failure 501.30 test_vpc_vpn.py
all_test_human_readable_logs Skipped --- test_human_readable_logs.py
all_test_image_store_object_migration Skipped --- test_image_store_object_migration.py

@shwstppr
Copy link
Contributor Author

@blueorangutan test keepEnv

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_01_redundant_vpc_site2site_vpn Failure 456.19 test_vpc_vpn.py
all_test_human_readable_logs Skipped --- test_human_readable_logs.py
all_test_image_store_object_migration Skipped --- test_image_store_object_migration.py

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants