Skip to content

Multiple CD-ROM / ISO Support Per VM#13101

Draft
Damans227 wants to merge 41 commits into
apache:mainfrom
Damans227:fr283-multi-cdrom
Draft

Multiple CD-ROM / ISO Support Per VM#13101
Damans227 wants to merge 41 commits into
apache:mainfrom
Damans227:fr283-multi-cdrom

Conversation

@Damans227

@Damans227 Damans227 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds multiple CD-ROM support per VM on KVM. Today CloudStack allows only one ISO per VM, forcing a manual ISO-swap workflow to install Windows on KVM (Windows installer + VirtIO drivers). After this PR each VM can hold up to vm.cdrom.max.count ISOs simultaneously, each appearing as its own CD-ROM inside the guest.

What changes:

  • detachIso takes an optional id (required when multiple ISOs are attached).
  • listVirtualMachines returns isos[] and cdrommaxcount; legacy isoid still reflects the bootable ISO.
  • New cluster-scoped config vm.iso.max.count (default 1). Values above the host-advertised cap fail loudly instead of silent clamping.
  • KVM agent advertises its supported CD-ROM count via the host.cdrom.max.count host detail; management reads from host_details, no hardcoded hypervisor numbers in management code.
  • New vm_iso_map table holds extra slots; user_vm.iso_id is kept as the bootable pointer. ISO deletion is gated by both tables.

Scope: KVM only.

Design doc: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=421957739

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

Screenshots (if appropriate):

Screen.Recording.2026-05-04.at.5.20.18.PM.mov
image

How Has This Been Tested?

  • End-to-end on a KVM lab across cap=1/2/5, plus the UI manually.
  • Unit tests added in TemplateManagerImplTest for slot allocation, the duplicate-attach check, and the detach-id resolution helper.

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

  • Set vm.cdrom.max.count above the host's advertised cap to confirm the validate-and-throw fires on attach/deploy
  • Tried to re-attach an already-attached ISO
  • Detached the bootable and non-bootable ISO in turn to confirm user_vm.iso_id and vm_iso_map stay in sync
  • Stopped and restarted a multi-ISO VM to confirm boot-time persistence
  • Confirmed legacy single-ISO API consumers (isoid in listVirtualMachines) see no functional change

@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 42.38806% with 193 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.78%. Comparing base (6bc83a3) to head (b9304dd).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...n/java/com/cloud/template/TemplateManagerImpl.java 39.41% 88 Missing and 15 partials ⚠️
...rc/main/java/com/cloud/vm/dao/VmIsoMapDaoImpl.java 0.00% 44 Missing ⚠️
...ava/com/cloud/api/query/dao/UserVmJoinDaoImpl.java 48.78% 15 Missing and 6 partials ⚠️
...apache/cloudstack/api/response/UserVmResponse.java 33.33% 8 Missing ⚠️
...ud/hypervisor/kvm/storage/KVMStorageProcessor.java 0.00% 7 Missing ⚠️
.../schema/src/main/java/com/cloud/vm/VmIsoMapVO.java 83.33% 3 Missing and 1 partial ⚠️
...ervisor/kvm/resource/LibvirtComputingResource.java 60.00% 2 Missing and 2 partials ⚠️
.../cloudstack/api/command/user/iso/DetachIsoCmd.java 0.00% 1 Missing ⚠️
...e/cloudstack/api/response/AttachedIsoResponse.java 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13101      +/-   ##
============================================
+ Coverage     18.75%   18.78%   +0.02%     
- Complexity    17966    18022      +56     
============================================
  Files          6160     6164       +4     
  Lines        552578   552927     +349     
  Branches      67348    67411      +63     
============================================
+ Hits         103660   103874     +214     
- Misses       437512   437619     +107     
- Partials      11406    11434      +28     
Flag Coverage Δ
uitests 3.53% <ø> (+<0.01%) ⬆️
unittests 19.98% <42.38%> (+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.

@Damans227

Copy link
Copy Markdown
Collaborator Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Damans227 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 ✖️ debian ✖️ suse15. SL-JID 17708

@Damans227

Copy link
Copy Markdown
Collaborator Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Damans227 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 17709

@blueorangutan

Copy link
Copy Markdown

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

@Damans227

Copy link
Copy Markdown
Collaborator Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Damans227 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 17863

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

@kiranchavala

Copy link
Copy Markdown
Member

@Damans227 can you resolve the merge conflicts

@kiranchavala

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@Damans227

Copy link
Copy Markdown
Collaborator Author

@Damans227 can you resolve the merge conflicts

Lemme take a look.

@blueorangutan

Copy link
Copy Markdown

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

Test Result Time (s) Test File

@Damans227

Copy link
Copy Markdown
Collaborator Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Damans227 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 ✖️ debian ✖️ suse15. SL-JID 18215

@Damans227

Copy link
Copy Markdown
Collaborator Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Damans227 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 18216

@Damans227

Copy link
Copy Markdown
Collaborator Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@Damans227 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 18217

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.

7 participants