Skip to content

Multiple CD-ROM / ISO Support Per VM#13101

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

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

Conversation

@Damans227
Copy link
Copy Markdown
Collaborator

@Damans227 Damans227 commented May 4, 2026

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
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

❌ Patch coverage is 41.28440% with 192 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.77%. Comparing base (6bc83a3) to head (817796d).

Files with missing lines Patch % Lines
...n/java/com/cloud/template/TemplateManagerImpl.java 39.54% 92 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 51.28% 13 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 ⚠️
.../cloudstack/api/command/user/iso/DetachIsoCmd.java 0.00% 1 Missing ⚠️
...e/cloudstack/api/response/AttachedIsoResponse.java 95.23% 0 Missing and 1 partial ⚠️
...ervisor/kvm/resource/LibvirtComputingResource.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13101      +/-   ##
============================================
+ Coverage     18.75%   18.77%   +0.01%     
- Complexity    17966    18011      +45     
============================================
  Files          6160     6164       +4     
  Lines        552578   552926     +348     
  Branches      67348    67410      +62     
============================================
+ Hits         103660   103799     +139     
- Misses       437512   437694     +182     
- Partials      11406    11433      +27     
Flag Coverage Δ
uitests 3.53% <ø> (+<0.01%) ⬆️
unittests 19.96% <41.28%> (+0.01%) ⬆️

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

Copy link
Copy Markdown
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

code lgtm. Left a few minor comments.

Copy link
Copy Markdown
Member

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

code LGTM

@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 17740

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

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

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

github-actions Bot commented Jun 8, 2026

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.

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