cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

systemvm-template: support on-demand download during setup and registration

Open shwstppr opened this issue 3 months ago • 51 comments

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: https://github.com/apache/cloudstack-documentation/pull/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)
  • [x] 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 avatar Sep 17 '25 10:09 shwstppr

Codecov Report

:x: Patch coverage is 74.00000% with 117 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 17.55%. Comparing base (51910cd) to head (b0dd56f). :warning: Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...om/cloud/upgrade/SystemVmTemplateRegistration.java 79.83% 57 Missing and 16 partials :warning:
...ain/java/com/cloud/storage/StorageManagerImpl.java 0.00% 37 Missing :warning:
.../cloudstack/utils/server/ServerPropertiesUtil.java 72.72% 4 Missing and 2 partials :warning:
.../java/com/cloud/storage/dao/VMTemplateDaoImpl.java 96.42% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11656      +/-   ##
============================================
+ Coverage     17.46%   17.55%   +0.09%     
- Complexity    15515    15600      +85     
============================================
  Files          5913     5914       +1     
  Lines        529371   529481     +110     
  Branches      64670    64691      +21     
============================================
+ Hits          92450    92973     +523     
+ Misses       426503   426072     -431     
- Partials      10418    10436      +18     
Flag Coverage Δ
uitests 3.58% <ø> (-0.01%) :arrow_down:
unittests 18.62% <74.00%> (+0.10%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Sep 17 '25 11:09 codecov[bot]

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

github-actions[bot] avatar Sep 27 '25 03:09 github-actions[bot]

@blueorangutan package

shwstppr avatar Sep 29 '25 06:09 shwstppr

@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 avatar Sep 29 '25 06:09 blueorangutan

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

blueorangutan avatar Sep 29 '25 08:09 blueorangutan

@blueorangutan package

shwstppr avatar Oct 13 '25 09:10 shwstppr

@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 avatar Oct 13 '25 09:10 blueorangutan

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

blueorangutan avatar Oct 13 '25 11:10 blueorangutan

@blueorangutan newpackage

shwstppr avatar Oct 27 '25 07:10 shwstppr

@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 avatar Oct 27 '25 07:10 blueorangutan

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

blueorangutan avatar Oct 27 '25 08:10 blueorangutan

@blueorangutan newpackage

shwstppr avatar Oct 27 '25 10:10 shwstppr

@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 avatar Oct 27 '25 10:10 blueorangutan

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

blueorangutan avatar Oct 27 '25 11:10 blueorangutan

@blueorangutan newpackage

shwstppr avatar Oct 28 '25 09:10 shwstppr

@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 avatar Oct 28 '25 09:10 blueorangutan

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

blueorangutan avatar Oct 28 '25 10:10 blueorangutan

@blueorangutan test

shwstppr avatar Oct 28 '25 11:10 shwstppr

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

blueorangutan avatar Oct 28 '25 11:10 blueorangutan

[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

blueorangutan avatar Oct 29 '25 06:10 blueorangutan

@blueorangutan test keepEnv

shwstppr avatar Oct 30 '25 07:10 shwstppr

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

blueorangutan avatar Oct 30 '25 07:10 blueorangutan

[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

blueorangutan avatar Oct 31 '25 03:10 blueorangutan

Thanks @sureshanaparti for the review, I've addressed your comments

@blueorangutan package

shwstppr avatar Nov 10 '25 13:11 shwstppr

@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 avatar Nov 10 '25 13:11 blueorangutan

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

blueorangutan avatar Nov 10 '25 15:11 blueorangutan

@blueorangutan newpackage

shwstppr avatar Nov 12 '25 06:11 shwstppr

@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 avatar Nov 12 '25 06:11 blueorangutan

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

blueorangutan avatar Nov 12 '25 08:11 blueorangutan

@blueorangutan newpackage

sureshanaparti avatar Nov 13 '25 06:11 sureshanaparti