Multiple CD-ROM / ISO Support Per VM by Damans227 · Pull Request #13101 · apache/cloudstack · GitHub
Skip to content

Multiple CD-ROM / ISO Support Per VM#13101

Merged
harikrishna-patnala merged 42 commits into
apache:mainfrom
Damans227:fr283-multi-cdrom
Jun 24, 2026
Merged

Multiple CD-ROM / ISO Support Per VM#13101
harikrishna-patnala merged 42 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

@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

@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

@kiranchavala kiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Tested manually

Able to attach multiple iso for a vm deployed on a kvm hypervisor based on the global and cluster level setting "vm.iso.max.count"

Test Case Execution Result
Validate the attach iso operations based on the Effective Cap ( vm.iso.max.count) at Global level Pass
Validate the attach iso operations based on the Effective Cap ( vm.iso.max.count) at Cluster level Pass
Runtime attach and detach of ISOs on a running VM Pass
Runtime attach and detach of ISOs on a stopped VM Pass
Check the listVirtualMachines api response includes isos Pass
Check the detach iso api call with the optional id parameter Pass

@github-actions

Copy link
Copy Markdown

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

@weizhouapache weizhouapache marked this pull request as ready for review June 24, 2026 09:15
Copilot AI review requested due to automatic review settings June 24, 2026 09:15

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@weizhouapache

Copy link
Copy Markdown
Member

@harikrishna-patnala harikrishna-patnala merged commit ea6cbad into apache:main Jun 24, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment