-
Notifications
You must be signed in to change notification settings - Fork 1.3k
kvm: allow skip forcing disk controller #11750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kvm: allow skip forcing disk controller #11750
Conversation
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 15217 |
|
@blueorangutan package |
|
@weizhouapache 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15219 |
|
@blueorangutan package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds functionality to allow skipping disk controller forcing for KVM VMs by introducing a new VM detail flag. The enhancement improves flexibility for UEFI VMs that may have specific disk controller requirements.
Key changes:
- Introduces a new VM detail constant
skip.force.disk.controllerto bypass default disk controller logic - Extracts disk definition logic into a separate method for better testability and maintainability
- Adds comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| VmDetailConstants.java | Adds new constant for the skip force disk controller feature |
| LibvirtComputingResource.java | Refactors disk definition logic and implements the skip functionality |
| LibvirtComputingResourceTest.java | Adds test coverage for the new disk definition method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...ypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
Outdated
Show resolved
Hide resolved
...ypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #11750 +/- ##
============================================
- Coverage 16.23% 16.23% -0.01%
- Complexity 13378 13380 +2
============================================
Files 5657 5657
Lines 498932 498942 +10
Branches 60552 60554 +2
============================================
- Hits 81016 81005 -11
- Misses 408882 408902 +20
- Partials 9034 9035 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vishesh92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
@blueorangutan package |
|
@vishesh92 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15246 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14511)
|
| DiskDef.DiskBus diskBusType, DiskDef.DiskBus diskBusTypeData, Map<String, String> details) { | ||
| boolean skipForceDiskController = MapUtils.getBoolean(details, VmDetailConstants.KVM_SKIP_FORCE_DISK_CONTROLLER, | ||
| false); | ||
| if (skipForceDiskController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shwstppr
This condition forces the root disk controller to use its configured settings instead of the UEFI workflow settings, even when the VM is deployed with UEFI and this setting "skip.force.disk.controller" is enabled. Consequently, a UEFI-deployed VM may fail to boot because some guest operating systems still depend on SATA disk. Please include a comment or a note detailing the change in behavior."
|
@blueorangutan package |
|
@RosiKyu 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16066 |
dfa2832 to
d1d9890
Compare
Fixes apache#9460 A VM or template detail can be added with key `skip.force.disk.controller` and value `true` to allow skipping forcing disk controllers for the VM especially in case of UEFI VMs. Otherwise, current behaviour of disk controllers depend on the guest OS, UEFI secure boot where Windows VM may always be provisioned with `sata` and other OS VMs with `virtio`. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
d1d9890 to
88d9334
Compare
|
@blueorangutan package |
|
@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. |
Related apache/cloudstack#11750 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16291 |
|
@blueorangutan test |
|
@RosiKyu a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15149)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Test Results
PR: #11750 - kvm: allow skip forcing disk controller
Issue: #9460
Tested on: CloudStack 4.20.3.0-SNAPSHOT
Environment: KVM (Oracle Linux 9), 2 hosts
API Tests
| Test | Description | Status |
|---|---|---|
| TC-001 | API detail availability via listDetailOptions | |
| TC-002 | Windows UEFI + skip flag - VirtIO persistence (main fix) | |
| TC-003 | Windows UEFI default behavior (SATA enforced) | |
| TC-004 | Linux UEFI default behavior (VirtIO enforced) | |
| TC-005 | Data disk attachment with skip flag | |
| TC-006 | Windows BIOS VM - no regression | |
| TC-007 | Template-level skip.force.disk.controller setting | |
| TC-008 | Detail priority - Instance overrides Template | |
| TC-009 | VM live migration with skip flag | |
| TC-010 | Different disk bus types (virtio, scsi, sata) | |
| TC-011 | Null/empty details map handling |
UI Tests
| Test | Description | Status |
|---|---|---|
| UI-001 | Verify skip.force.disk.controller appears in VM Settings | |
| UI-002 | Set skip.force.disk.controller via UI | |
| UI-003 | Verify Template Settings |
Key Observations
-
Main bug fix verified: Windows UEFI Secure Boot VMs with
skip.force.disk.controller=truemaintain VirtIO disk controllers through stop/start cycles. -
API:
listDetailOptionsrequires aresourceid(VM UUID) parameter to return hypervisor-specific details - thehypervisorparameter alone is insufficient. -
Detail Priority: Instance-level details override template-level details (standard CloudStack behavior).
-
No Regressions: Default UEFI behavior (SATA for Windows, VirtIO for Linux) preserved when skip flag is not set.
Detailed Test Results
Can be found in the following pdf: Detailed Test Results PR #11750.pdf
Description
Fixes #9460
A VM or template detail can be added with key
skip.force.disk.controllerand valuetrueto allow skipping forcing disk controllers for the VM especially in case of UEFI VMs.Otherwise, current behaviour of disk controllers depend on the guest OS, UEFI secure boot where Windows VM may always be provisioned with
sataand other OS VMs withvirtio.Doc PR: apache/cloudstack-documentation#616
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?