apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.09k stars 1.11k forks source link

RootDiskController setting not Honored throughout Instance lifecycle #9460

Open tyradyne opened 3 months ago

tyradyne commented 3 months ago
ISSUE TYPE
COMPONENT NAME
~~~ Instances ~~~ ##### CLOUDSTACK VERSION
4.19.1.0
CONFIGURATION

Advanced Networking

OS / ENVIRONMENT

KVM

SUMMARY

When creating a Windows Instance configured with "rootDiskController=virtio" in Settings and using UEFI Secure Boot in the OS, existing and added Disks, initially configured with virtio scsi controllers, will lose these controller settings and revert to basic sata controllers after a stop and start. This behavior does not occur on Windows Instance using BIOS boot.

STEPS TO REPRODUCE
Create Windows 2019 Instance that is assigned the setting "rootDiskController=virtio" and uses UEFI Secure Boot. Install all necessary VirtIO drivers. Reboot the Instance. Log in and Open Device Manager in Windows. Hot-add new Volume to Windows Instance through CloudStack and observe in the OS that the newly added disk will be the correct "Red Hat VirtIO SCSI Disk Device" and the Storage Controller will be the correct "Red Hat VirtIO SCSI Controller." Stop the Instance. Start the Instance. Log in and open Device Manager in OS. Observe that both disks are now "QEMU HARDDISK" and the Storage Controller has been removed. 
EXPECTED RESULTS
Expected results are that the Disk Controller and Volume settings would persist for the entirety of the Instance Lifecycle. The Disk Controller would remain in the following state as seen in this virsh file snippit. This excerpt is from before the Instance was stopped:

<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/mnt/7fe777bd-cd27-3b37-bf4c-dc94fcbe6d33/0b4b8825-1465-4221-b42d-8827688baac3' index='4'/>
<backingStore/>
<target dev='vdb' bus='virtio'/>
<serial>0b4b882514654221b42d</serial>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</disk>
ACTUAL RESULTS
After Shutdown and Startup, the Disk Controller and Volume settings are changed to the following state in the OS and in the virsh file:

<disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="none"/>
<source file="/mnt/7fe777bd-cd27-3b37-bf4c-dc94fcbe6d33/0b4b8825-1465-4221-b42d-8827688baac3" index="2"/>
<backingStore/>
<target dev="sdb" bus="sata"/>
<serial>0b4b882514654221b42d</serial>
<alias name="sata0-0-1"/>
<address type="drive" controller="0" bus="0" target="0" unit="1"/>
boring-cyborg[bot] commented 3 months ago

Thanks for opening your first issue here! Be sure to follow the issue template!

andrijapanicsb commented 3 months ago

Sounds like a nice bug

Cc @weizhouapache @rohityadavcloud @sureshanaparti