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 package 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.56%. Comparing base (bfc4f60) to head (4bd5458).
⚠️ Report is 32 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.56%            
- Complexity    15540    15541     +1     
==========================================
  Files          5909     5911     +2     
  Lines        529045   529381   +336     
  Branches      64615    64661    +46     
==========================================
+ Hits          92933    93000    +67     
- Misses       425657   425920   +263     
- Partials      10455    10461     +6     
Flag Coverage Δ
uitests 3.58% <ø> (+<0.01%) ⬆️
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
@blueorangutan
Copy link

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

@shwstppr shwstppr closed this Nov 11, 2025
@shwstppr shwstppr reopened this Nov 11, 2025
@apache apache deleted a comment from blueorangutan Nov 12, 2025
@apache apache deleted a comment from blueorangutan Nov 12, 2025
@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 15725

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 newpackage

@blueorangutan
Copy link

@sureshanaparti 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 ✔️ debian ✖️ suse15. SL-JID 15740

@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@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 15761

@shwstppr
Copy link
Contributor Author

@blueorangutan test matrix

@blueorangutan
Copy link

@shwstppr a [SL] Trillian-Jenkins matrix job (EL8 mgmt + EL8 KVM, Ubuntu22 mgmt + Ubuntu22 KVM, EL8 mgmt + VMware 7.0u3, EL9 mgmt + XCP-ng 8.2 ) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14845)

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14844)

@blueorangutan
Copy link

[SF] Trillian test result (tid-14842)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 51144 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11656-t14842-kvm-ol8.zip
Smoke tests completed. 150 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

[SF] Trillian test result (tid-14843)
Environment: kvm-ubuntu22 (x2), zone: Advanced Networking with Mgmt server u22
Total time taken: 58009 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11656-t14843-kvm-ubuntu22.zip
Smoke tests completed. 149 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_list_cpvm_vm Failure 0.04 test_ssvm.py
test_04_cpvm_internals Failure 0.04 test_ssvm.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-14846)
Environment: vmware-70u3 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 52712 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11656-t14846-vmware-70u3.zip
Smoke tests completed. 130 look OK, 1 have errors, 19 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_vpn_usage Error 1.10 test_usage.py
all_test_vm_deployment_planner Skipped --- test_vm_deployment_planner.py
all_test_vm_life_cycle Skipped --- test_vm_life_cycle.py
all_test_vm_lifecycle_unmanage_import Skipped --- test_vm_lifecycle_unmanage_import.py
all_test_vm_lifecycle_unmanage_kvm_import Skipped --- test_vm_lifecycle_unmanage_kvm_import.py
all_test_vm_lifecycle_with_snapshot_or_volume Skipped --- test_vm_lifecycle_with_snapshot_or_volume.py
all_test_vm_schedule Skipped --- test_vm_schedule.py
all_test_vm_snapshot_kvm Skipped --- test_vm_snapshot_kvm.py
all_test_vm_snapshots Skipped --- test_vm_snapshots.py
all_test_vm_strict_host_tags Skipped --- test_vm_strict_host_tags.py
all_test_vnf_templates Skipped --- test_vnf_templates.py
all_test_volumes Skipped --- test_volumes.py
all_test_vpc_ipv6 Skipped --- test_vpc_ipv6.py
all_test_vpc_redundant Skipped --- test_vpc_redundant.py
all_test_vpc_router_nics Skipped --- test_vpc_router_nics.py
all_test_vpc_vpn Skipped --- test_vpc_vpn.py
all_test_webhook_delivery Skipped --- test_webhook_delivery.py
all_test_webhook_lifecycle Skipped --- test_webhook_lifecycle.py
all_test_host_maintenance Skipped --- test_host_maintenance.py
all_test_hostha_kvm Skipped --- test_hostha_kvm.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.

4 participants