andrijapanicsb commented on code in PR #10213:
URL: https://github.com/apache/cloudstack/pull/10213#discussion_r4688751468
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -3149,11 +3149,7 @@ public int compare(final DiskTO arg0, final DiskTO arg1)
{
if (volume.getType() == Volume.Type.DATADISK &&
!(isWindowsTemplate && isUefiEnabled)) {
disk.defFileBasedDisk(physicalDisk.getPath(), devId,
diskBusTypeData, DiskDef.DiskFmtType.QCOW2);
} else {
- if (isSecureBoot) {
- disk.defFileBasedDisk(physicalDisk.getPath(),
devId, DiskDef.DiskFmtType.QCOW2, isWindowsTemplate);
- } else {
- disk.defFileBasedDisk(physicalDisk.getPath(),
devId, diskBusType, DiskDef.DiskFmtType.QCOW2);
- }
+ disk.defFileBasedDisk(physicalDisk.getPath(), devId,
diskBusType, DiskDef.DiskFmtType.QCOW2);
Review Comment:
Thanks for the background on the original UEFI work. I looked into this
claim and tested it.
**Short version:** I found no evidence that virtio disks break Windows under
UEFI Secure Boot, and my tests show the
opposite. Secure Boot checks signatures, not the disk bus. As far as I can
find, no log, error code or reproduction
was ever posted for the original observation (#3638, #4773, #10213).
**What I tested**
- Windows Server 2025 on CloudStack with Secure Boot (q35,
`OVMF_CODE.secboot.fd` with SMM, `bootmode=secure`), both
disks on `bus='virtio'`, CD-ROMs on SATA. Two runs; both booted, finished
their first boot and ran the guest agent.
- The same guest on KVM with the Microsoft keys enrolled, boot disk on
virtio-blk: `Confirm-SecureBootUEFI` returned
`True` inside Windows, on the first boot and after a reboot.
- Windows Server 2019 on CloudStack UEFI with virtio disks (Secure Boot
off): several runs, all fine.
- virtio-win ships the same viostor build for Server 2016, 2019, 2022 and
2025. Only 2025 was run with Secure Boot on
virtio.
**When Windows really fails**
None of these cases is caused by the disk bus:
1. **No virtio storage driver in the guest**, for example Windows installed
from Microsoft media onto SATA or IDE.
Booting from virtio then stops with `INACCESSIBLE_BOOT_DEVICE`, with or
without Secure Boot. That is a fair reason
for a SATA default when no controller is set, not for overriding an
explicit setting.
2. **Test-signed or self-built drivers.** Secure Boot policy prevents
enabling `TESTSIGNING`
([Microsoft
docs](https://learn.microsoft.com/en-us/windows-hardware/drivers/install/the-testsigning-boot-configuration-option)),
so a setup that relied on test signing works only with Secure Boot off.
The cause is the signature, not the bus.
3. **Drivers signed in a way the Windows edition does not accept.**
Microsoft describes attestation signing as "for
testing on Windows 10 client only systems"
([Microsoft
docs](https://learn.microsoft.com/en-us/windows-hardware/drivers/install/kernel-mode-code-signing-policy--windows-vista-and-later-)).
The same applies to certificate chains the guest does not trust, such as
`smbus.inf` from virtio-win 0.1.285 on
Server 2025 ("terminated in a root certificate which is not trusted"),
and to older Windows releases that cannot
validate SHA-2 signatures.
4. **Firmware keys that do not match the boot manager**: the CA that signed
it is missing from `db`, or the boot
manager is revoked through `dbx`. This fails in the firmware, before any
disk driver loads.
5. **The first boot after moving an existing guest from SATA to virtio.**
- Windows swaps in the real viostor driver on the boot disk and schedules
its own restart.
- Driver installs running at that moment fail with "The Plug and Play
service is not available".
- With the stock virt-v2v first-boot script, this can turn into a reboot
loop (virt-v2v #178, #202).
It is a first-boot sequencing issue, not a Secure Boot one.
**For this PR:** forcing SATA only covers case 1, and it overrides every
operator who sets virtio on purpose. This
change keeps the SATA default when no controller is set, and honours
`rootDiskController` and `dataDiskController`
when they are set, as is already the case for RBD and CLVM pools.
If there is a specific Windows version or scenario to check, I can run it
and post the results.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]