Skip to content

template: Update builtin templates from CentOS 5.x to Debian 13 - #14493

Open
weizhouapache wants to merge 33 commits into
apache:mainfrom
shapeblue:24-builtin-debian13-templates
Open

weizhouapache wants to merge 33 commits into
apache:mainfrom
shapeblue:24-builtin-debian13-templates

Conversation

@weizhouapache

@weizhouapache weizhouapache commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

This PR replaces the built-in CentOS 5.x templates with Debian 13 (trixie) templates, and moves the smoke tests to them. More discussion on #13797

Templates

  • setup/db/templates.sql: the KVM (qcow2), XenServer (vhd.bz2) and VMware (ova) built-in templates are the Debian 13 genericcloud amd64 images (20261026-2643) patched for CloudStack, downloaded from download.cloudstack.org, with their SHA-512 checksums.
  • scripts/util/build-acs-image.sh: new script that patches, shrinks and converts a cloud image (qcow2) to VHD, OVA and XenServer VHD for CloudStack, and creates SHA512SUMS. It installs nfs-common in the Debian and Ubuntu images, because the guest needs an NFS client to mount a shared file system.
  • The old CentOS 5 built-in template inserts are removed from schema-21to22.sql and schema-2214to30.sql.
  • The 4.23.0.0 to 4.24.0.0 upgrade sets the guest OS of the Debian 13 built-in templates to Debian GNU/Linux 12 (64-bit), looked up by name because the guest OS is only added by a later upgrade script with an auto-generated id. The VMware template is renamed debian13-x86_64-vmware to match the KVM and XenServer names. The 4.3 upgrade statement that forced the XenServer built-in template back to guest OS 142 is dropped.

Fix for the template download

  • When a template download fails with an error answer that has no install path (for example the timeout when the secondary storage VM disconnects during the download), the download callback no longer clears the install path of the template_store_ref entry. Before, the install path became null and the next download of the template went to a directory named null, which failed.

Smoke tests

  • get_suitable_test_template returns the shared public test template (tiny-kvm on KVM), registered by the admin only when it is missing, and falls back to the built-in template. Tests that only need a small guest use it.
  • Tests that need more from the guest use the Debian 13 built-in template taken with get_template on every hypervisor: test_attach_multiple_volumes, test_volumes (with the 512 MiB offering), test_backup_recovery_nas, test_backup_recovery_kboss, test_primary_storage, test_vm_autoscaling.
  • test_snapshots: the standalone backup class registers its own template again, because it deletes the template.
  • test_backup_recovery_nas: sync the guest after writing the marker files, so that they are in the backup.

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?

  • Ran the smoke tests on a KVM environment with the Debian 13 built-in templates, and re-ran the failing tests after fixing them.
  • Registered the VMware OVA and downloaded the built-in VMware template on a VMware (vSphere) environment.
  • Fix for the null install path: on the VMware environment, restarted the secondary storage VM while a template was downloading. The entry went to DOWNLOAD_ERROR and kept its install path (template/tmpl/<account id>/<template id>). After the next sync the template was downloaded to that path, and no null directory was created. Before the fix the install path was cleared.
  • Unit tests: BaseImageStoreDriverImplTest (the install path is kept for an error answer without one and set when the answer has one).

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

  • Interrupted a template download by restarting the secondary storage VM, as above.

- templates.sql: use the patched Debian 13 images (20261017-2634) from
  http://10.0.34.8/templates/debian-13-genericcloud-amd64/ for the KVM,
  XenServer (vhd.bz2) and VMware (ova) templates, with their SHA-512
  checksums
- scripts/util/build-acs-image.sh: new script to patch, shrink and
  convert a cloud image (qcow2) to VHD, OVA and XenServer VHD for
  CloudStack, and to create SHA512SUMS
- schema-21to22.sql, schema-2214to30.sql: remove the inserts of the old
  CentOS 5 builtin templates (ids 4, 7 and 5)
…n 12 (64-bit)

templates.sql cannot reference the 'Debian GNU/Linux 12 (64-bit)' guest OS
because it is only added by a later upgrade script with an auto-generated id.
Update the guest_os_id of the built-in Debian 13 templates (KVM, XenServer,
VMware) in the 4.23.0.0 to 4.24.0.0 upgrade, looking the guest OS up by name.

Also rename the VMware built-in template to debian13-x86_64-vmware to match the
KVM and XenServer names, and drop the 4.3 upgrade statement that forced the
XenServer built-in template back to guest OS 142.
get_suitable_test_template now returns the shared public test template
(tiny-kvm on KVM), registered by the admin only when it is missing, and
falls back to the built-in template. It was already doing this for
XenServer. The hypervisor argument is optional and is detected from the
hosts when not given.

Tests that only need a small guest now use it instead of the built-in
template, and test_ipv4_routing, test_snapshots and test_restore_vm no
longer register their own copy of the tiny template.

Tests that depend on the built-in template are not changed, for example
test_deploy_vm_root_resize (needs a template of at least 1 GiB),
test_templates, test_sharedfs_lifecycle and test_vm_autoscaling.
…again

TestSnapshotStandaloneBackup takes a snapshot, expunges the VM and then
deletes its template, to test the snapshot without its template. It needs
its own template, so it cannot use the shared public test template.
The Debian 13 cloud image has no NFS client, so mounting an NFS share in the
guest fails with "NFS: mount program didn't pass remote address". The shared
file system smoke test mounts the share in the guest. Install nfs-common
with the other guest packages.
Moving the smoke tests to the shared tiny-kvm template broke the tests that
need more from the guest. Run these on the Debian 13 built-in template, taken
with get_template on every hypervisor.

- test_attach_multiple_volumes, test_volumes: they detach data disks from a
  running VM, which the tiny-kvm guest never releases.
- test_backup_recovery_nas, test_backup_recovery_kboss: they create a VM from a
  backup and expect the files written in the guest to be in it.
- test_primary_storage: it puts a primary storage with running VMs in
  maintenance, which needs a guest that shuts down on request.
- test_volumes: use the 512 MiB big offering, as the Debian 13 guest does not
  boot with the 128 MiB tiny or the 256 MiB small offering.
- test_vm_autoscaling: the scale up condition needs at least 1 percent CPU, and
  an idle Debian 13 VM uses about 0.4 percent. Start a CPU loop from the
  template user data.
… templates

The images were rebuilt with the nfs-common package installed. The URLs are
unchanged, so the KVM, XenServer and VMware templates get the checksums of
the new files.
…n templates

The images are built from the Debian 13 genericcloud image of 20261021-2638
with the nfs-common package installed. Update the URLs and the SHA-512
checksums of the KVM, XenServer and VMware templates.
The tests write a file in the guest and take a live backup a few seconds later.
The backup is not quiesced, so a file that was not flushed yet can be missing
from the backup. The guest root filesystem commits its journal about every 5
seconds, which is also the wait before the backup. Run sync after each touch,
so that the file is on the disk before the backup starts.
@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 3.44828% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.79%. Comparing base (b9b5436) to head (294ba28).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...om/cloud/hypervisor/vmware/util/VmwareContext.java 0.00% 56 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14493      +/-   ##
============================================
+ Coverage     20.75%   20.79%   +0.03%     
- Complexity    21901    21936      +35     
============================================
  Files          6496     6496              
  Lines        591602   591690      +88     
  Branches      72583    72593      +10     
============================================
+ Hits         122814   123017     +203     
+ Misses       455456   455322     -134     
- Partials      13332    13351      +19     
Flag Coverage Δ
uitests 3.88% <ø> (ø)
unittests 22.10% <3.44%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan test matrix

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins matrix job (ol8 mgmt + kvm-ol8, ubuntu24 mgmt + kvm-ubuntu24, ol8 mgmt + vmware-70u3, ol9 mgmt + xcpng82) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17238)

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17240)

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17239)

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17237)

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-133)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8, storage: NFS (x2)
Total time taken: 55037 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14493-n133-kvm-ol8.zip
Smoke tests completed. 157 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
Copy Markdown

[SF] Trillian test result (tid-135)
Environment: xcpng83 (x2), zone: Advanced Networking with Mgmt server ol8, storage: NFS (x2)
Total time taken: 59639 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14493-n135-xcpng83.zip
Smoke tests completed. 153 look OK, 4 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_deploy_vms_storage_tags Error 7.22 test_primary_storage.py
test_05_scale_vm_dont_allow_disk_offering_change Error 176.82 test_scale_vm.py
test_01_create_volume Error 5.38 test_volumes.py
test_02_attach_volume Error 2.10 test_volumes.py
test_03_download_attached_volume Error 1.08 test_volumes.py
test_04_delete_attached_volume Error 3.16 test_volumes.py
test_05_detach_volume Error 1.07 test_volumes.py
test_06_download_detached_volume Error 3.16 test_volumes.py
test_08_resize_volume Error 1.08 test_volumes.py
test_09_delete_detached_volume Error 3.31 test_volumes.py
test_12_resize_volume_with_only_size_parameter Error 66.22 test_volumes.py
ContextSuite context=TestVolumes>:teardown Error 4.49 test_volumes.py
test_02_cancel_host_maintenace_with_migration_jobs Error 4.55 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Failure 3.72 test_host_maintenance.py

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-132)
Environment: kvm-ubuntu26 (x2), zone: Advanced Networking with Mgmt server u26, storage: NFS (x2)
Total time taken: 61327 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14493-n132-kvm-ubuntu26.zip
Smoke tests completed. 156 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_03_scale_down_verify Failure 308.96 test_vm_autoscaling.py
test_04_stop_remove_vm_in_vmgroup Failure 13.74 test_vm_autoscaling.py

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-137)
Environment: vmware-80u3 (x2), zone: Advanced Networking with Mgmt server ol8, storage: NFS (x2)
Total time taken: 82110 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14493-n137-vmware-80u3.zip
Smoke tests completed. 119 look OK, 6 have errors, 32 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_04_readiness_cache_invalidated_on_out_of_band_restart Error 135.04 test_instance_boot_group.py
test_08_upgrade_kubernetes_ha_cluster Failure 3698.26 test_kubernetes_clusters.py
test_list_vms_metrics_admin Error 3625.63 test_metrics_api.py
test_list_vms_metrics_history Error 25.99 test_metrics_api.py
test_list_volumes_metrics_history Error 3609.86 test_metrics_api.py
test_01_nic Error 1070.35 test_nic.py
test_01_scale_vm Error 842.27 test_scale_vm.py
test_02_scale_vm_negative_offering_disable_scaling Error 725.95 test_scale_vm.py
test_03_scale_vm_negative_vm_disable_scaling Error 711.05 test_scale_vm.py
test_04_scale_vm_with_user_account Error 857.43 test_scale_vm.py
test_05_scale_vm_dont_allow_disk_offering_change Error 0.20 test_scale_vm.py
ContextSuite context=TestSharedFSLifecycle>:setup Error 0.00 test_sharedfs_lifecycle.py
all_test_snapshots Skipped --- test_snapshots.py
all_test_ssl_offloading Skipped --- test_ssl_offloading.py
all_test_ssvm Skipped --- test_ssvm.py
all_test_staticroles Skipped --- test_staticroles.py
all_test_storage_policy Skipped --- test_storage_policy.py
all_test_systemvm_userdata Skipped --- test_systemvm_userdata.py
all_test_templates Skipped --- test_templates.py
all_test_update_security_group Skipped --- test_update_security_group.py
all_test_usage_events Skipped --- test_usage_events.py
all_test_usage Skipped --- test_usage.py
all_test_vm_autoscaling Skipped --- test_vm_autoscaling.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_conserve_mode Skipped --- test_vpc_conserve_mode.py
all_test_vpc_firewall_rules Skipped --- test_vpc_firewall_rules.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

The usage text is printed from the header comment, so the line range it prints
is moved down by the length of the license.
…d.cloudstack.org

The images are the same 20261021-2638 files with the same checksums, now
served from download.cloudstack.org instead of the build server.
An error answer, like the timeout when the secondary storage VM
disconnects during a download, has no install path. The download
callback wrote it to the template_store_ref entry anyway, so the install
path became null and the next download of the template went to a
directory named "null".

Only update the install path when the answer has one.
@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues

Review effort: Lite

Comment thread setup/db/templates.sql Resolved
Comment thread setup/db/templates.sql Resolved
@blueorangutan

Copy link
Copy Markdown

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

Copilot AI balanced review requested due to automatic review settings November 5, 2026 20:47
* vmware-base: fix template copy from secondary to primary

* vmware-base: refactoring

* test: revert curl commands to wget in test_routers_network_ops (PR 13977)

Revert test_routers_network_ops.py back to wget commands after fixing underlying
macchina VM file system corruption issue.

Context:
- Previous commit changed wget to curl due to libpcre.so.1 library error in macchina VMs
- Error was: 'wget: /usr/lib/libpcre.so.1 is not an ELF file'
- Root cause: file system corruption during template copy from secondary to primary storage
- Fix: PR 13977 (vmware-base: fix template copy from secondary to primary) resolves the issue
- This revert verifies wget is working correctly again after the underlying fix

Changes:
- Replace 'curl -v -m 1 -o index.html -sL www.google.com' back to 'wget -t 1 -T <timeout> www.google.com'
- Affects TestRedundantIsolateNetworks and TestIsolatedNetworks test classes
- Apply timeout values of 5 or 1 second depending on test context
Added EXISTS clause to ensure guest OS is available before updating vm_template records for Debian 13.
@weizhouapache
weizhouapache force-pushed the 24-builtin-debian13-templates branch from e913f50 to 31fcf80 Compare November 5, 2026 20:51
@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

4 open issues
1 resolved since last review

Review effort: Lite

Comment thread setup/db/templates.sql Resolved
Comment thread setup/db/templates.sql Resolved
Copilot AI balanced review requested due to automatic review settings November 5, 2026 21:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@blueorangutan

Copy link
Copy Markdown

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

Copilot AI balanced review requested due to automatic review settings November 6, 2026 15:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed to evaluate unpublished risks involving zone-specific image selection, template userdata overrides, stalled VMware uploads, and stale image checksums.

No open issues 🎉

4 resolved since last review

Review effort: Balanced

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache 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
Copy Markdown

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

@weizhouapache

Copy link
Copy Markdown
Member Author

@blueorangutan test matrix

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins matrix job (ol8 mgmt + kvm-ol8, ubuntu24 mgmt + kvm-ubuntu24, ol8 mgmt + vmware-70u3, ol9 mgmt + xcpng82) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17499)

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17498)

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17497)

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-17496)

This branch has not been deployed

No deployments
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