Skip to content

RootDiskController setting not Honored throughout Instance lifecycle  #9460

Closed

Description

@tyradyne
ISSUE TYPE
  • Bug Report
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"/>


Activity

  1. boring-cyborg commented on Jul 26, 2024

    @boring-cyborg

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

  2. andrijapanicsb commented on Jul 28, 2024

    @andrijapanicsb
    Contributor
  3. added this to the 4.20.0.0 milestone on Jul 28, 2024
  4. modified the milestones: 4.20.0.0, 4.19.2.0 on Jul 30, 2024
  5. added a commit that references this issue on Jan 20, 2025
    edd537f
  6. modified the milestones: 4.19.2, 4.19.3 on Feb 13, 2025
  7. added theissue type on Mar 5, 2025
  8. 12 remaining items

  9. modified the milestones: 4.20.2, 4.20.3 on Oct 23, 2025
  10. tyradyne commented on Oct 29, 2025

    @tyradyne
    Author

    @shwstppr Wouldn't the SATA device be the Optical Drive? What is "it" in your message? Which Volume? The Boot Volume or another one? I ask because we are still seeing this issue occur. Thanks.

  11. shwstppr commented on Oct 29, 2025

    @shwstppr
    Contributor

    @tyradyne I'm not completely sure now as it has been a few weeks since I tested but I think I was referring to the ROOT volume disk controller. Can retest and confirm in the next few days.
    The PR I mentioned is not merged yet so I don't think we have any resolution for the behaviour as of now

  12. moved this from ready for Testing to In Review in Apache CloudStack BugFest - Issueson Nov 3, 2025
  13. tyradyne commented on Nov 17, 2025

    @tyradyne
    Author

    @shwstppr Hello, have you bee able to retest and confirm whether you were looking at the ROOT disk or the SATA Optical Drive in terms of RootDiskController settings? Would you please share the testing screenshots? Thank you.

  14. daviftorres commented on Nov 17, 2025

    @daviftorres
    Contributor

    Hey @tyradyne , I reported this issue #12041 that refers to DiskController in the VMWare context. DO you think they both could be related and potentially solved by the same code changes?

  15. shwstppr commented on Nov 27, 2025

    @shwstppr
    Contributor

    @tyradyne sorry I got busy with other things. I'll try to get back to you on your query by tomorrow

  16. shwstppr commented on Nov 29, 2025

    @shwstppr
    Contributor

    @tyradyne here is my test, deployed a Windows UEFI VM with rootDiskController set to virtio and having an additional DATA disk,

    (localcloud) 🐱 > list templates templatefilter=self id=87fd7d01-9c26-4384-827b-1e57efe005af filter=id,name,details,ostype,ostypeid,ostypename
    {
      "count": 1,
      "template": [
        {
          "details": {
            "rootDiskController": "virtio"
          },
          "id": "87fd7d01-9c26-4384-827b-1e57efe005af",
          "name": "mock-win-test",
          "ostypeid": "9646ad06-fd94-4982-85cc-e513d088859a",
          "ostypename": "Windows 11 (64-bit)"
        }
      ]
    }
    (localcloud) 🐱 > list virtualmachines id=36599aa6-0d4b-4745-9a3b-86677b706d71 filter=id,name,details,templateid,templatename,instancename
    {
      "count": 1,
      "virtualmachine": [
        {
          "details": {
            "UEFI": "SECURE",
            "cpuOvercommitRatio": "2.0",
            "rootDiskController": "virtio"
          },
          "id": "36599aa6-0d4b-4745-9a3b-86677b706d71",
          "instancename": "i-2-5-VM",
          "name": "vm-2",
          "templateid": "87fd7d01-9c26-4384-827b-1e57efe005af",
          "templatename": "mock-win-test"
        }
      ]
    }
    (localcloud) 🐱 > list volumes virtualmachineid=36599aa6-0d4b-4745-9a3b-86677b706d71 filter=id,name,type,path
    {
      "count": 2,
      "volume": [
        {
          "id": "b311ca09-2471-4848-a96b-57379aa2a576",
          "name": "ROOT-5",
          "path": "b311ca09-2471-4848-a96b-57379aa2a576",
          "type": "ROOT"
        },
        {
          "id": "575f5435-ea63-48e7-a7d4-e7a12f8e16c9",
          "name": "DATA-5",
          "path": "575f5435-ea63-48e7-a7d4-e7a12f8e16c9",
          "type": "DATADISK"
        }
      ]
    }
    

    VM definition showed SATA for device bus,

    root@ref-trl-6121-k-Mr9-abhishek-kumar-kvm1 ~]# virsh dumpxml i-2-5-VM | xmllint --xpath '/domain/devices' - | xmllint --format -
    <?xml version="1.0"?>
    <devices>
      <emulator>/usr/libexec/qemu-kvm</emulator>
      <disk type="file" device="disk">
        <driver name="qemu" type="qcow2" cache="none"/>
        <source file="/mnt/99bdc5a9-da8e-3eaf-ace3-d052edae3012/b311ca09-2471-4848-a96b-57379aa2a576" index="3"/>
        <backingStore type="file" index="4">
          <format type="qcow2"/>
          <source file="/mnt/99bdc5a9-da8e-3eaf-ace3-d052edae3012/87fd7d01-9c26-4384-827b-1e57efe005af"/>
          <backingStore/>
        </backingStore>
        <target dev="sda" bus="sata"/>
        <serial>b311ca0924714848a96b</serial>
        <alias name="sata0-0-0"/>
        <address type="drive" controller="0" bus="0" target="0" unit="0"/>
      </disk>
      <disk type="file" device="disk">
        <driver name="qemu" type="qcow2" cache="none"/>
        <source file="/mnt/28a584ff-a6a6-30ca-9e3f-b747039d4dd6/575f5435-ea63-48e7-a7d4-e7a12f8e16c9" index="2"/>
        <backingStore/>
        <target dev="sdb" bus="sata"/>
        <serial>575f5435ea6348e7a7d4</serial>
        <alias name="sata0-0-1"/>
        <address type="drive" controller="0" bus="0" target="0" unit="1"/>
      </disk>
      <disk type="file" device="cdrom">
        <driver name="qemu"/>
        <target dev="sdd" bus="sata"/>
        <readonly/>
        <alias name="sata0-0-3"/>
        <address type="drive" controller="0" bus="0" target="0" unit="3"/>
      </disk>
      <controller type="usb" index="0" model="qemu-xhci">
        <alias name="usb"/>
        <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
      </controller>
      <controller type="sata" index="0">
        <alias name="ide"/>
        <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
      </controller>
      <controller type="pci" index="0" model="pcie-root">
        <alias name="pcie.0"/>
      </controller>
      <controller type="pci" index="1" model="pcie-root-port">
        <model name="pcie-root-port"/>
        <target chassis="1" port="0x10"/>
        <alias name="pci.1"/>
        <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
      </controller>
      <controller type="pci" index="2" model="pcie-to-pci-bridge">
        <model name="pcie-pci-bridge"/>
        <alias name="pci.2"/>
        <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
      </controller>
      <controller type="pci" index="3" model="pcie-root-port">
        <model name="pcie-root-port"/>
        <target chassis="3" port="0x11"/>
        <alias name="pci.3"/>
        <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
      </controller>
      <controller type="pci" index="4" model="pcie-root-port">
        <model name="pcie-root-port"/>
        <target chassis="4" port="0x12"/>
        <alias name="pci.4"/>
        <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
      </controller>
      <controller type="pci" index="5" model="pcie-root-port">
        <model name="pcie-root-port"/>
        <target chassis="5" port="0x13"/>
        <alias name="pci.5"/>
        <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
      </controller>
      <controller type="pci" index="6" model="pcie-root-port">
        <model name="pcie-root-port"/>
        <target chassis="6" port="0x14"/>
        <alias name="pci.6"/>
        <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
      </controller>
      <controller type="virtio-serial" index="0">
        <alias name="virtio-serial0"/>
        <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
      </controller>
      <interface type="bridge">
        <mac address="02:01:00:cc:00:02"/>
        <source bridge="breth1-1878"/>
        <bandwidth>
          <inbound average="25600" peak="25600"/>
          <outbound average="25600" peak="25600"/>
        </bandwidth>
        <target dev="vnet7"/>
        <model type="e1000"/>
        <link state="up"/>
        <alias name="net0"/>
        <address type="pci" domain="0x0000" bus="0x02" slot="0x01" function="0x0"/>
      </interface>
      <serial type="pty">
        <source path="/dev/pts/4"/>
        <target type="isa-serial" port="0">
          <model name="isa-serial"/>
        </target>
        <alias name="serial0"/>
      </serial>
      <console type="pty" tty="/dev/pts/4">
        <source path="/dev/pts/4"/>
        <target type="serial" port="0"/>
        <alias name="serial0"/>
      </console>
      <channel type="unix">
        <source mode="bind" path="/var/lib/libvirt/qemu/i-2-5-VM.org.qemu.guest_agent.0"/>
        <target type="virtio" name="org.qemu.guest_agent.0" state="disconnected"/>
        <alias name="channel0"/>
        <address type="virtio-serial" controller="0" bus="0" port="1"/>
      </channel>
      <input type="tablet" bus="usb">
        <alias name="input0"/>
        <address type="usb" bus="0" port="1"/>
      </input>
      <input type="mouse" bus="ps2">
        <alias name="input1"/>
      </input>
      <input type="keyboard" bus="ps2">
        <alias name="input2"/>
      </input>
      <graphics type="vnc" port="5903" autoport="yes" listen="10.1.35.200">
        <listen type="address" address="10.1.35.200"/>
      </graphics>
      <audio id="1" type="none"/>
      <video>
        <model type="cirrus" vram="16384" heads="1" primary="yes"/>
        <alias name="video0"/>
        <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
      </video>
      <watchdog model="i6300esb" action="none">
        <alias name="watchdog0"/>
        <address type="pci" domain="0x0000" bus="0x02" slot="0x02" function="0x0"/>
      </watchdog>
      <watchdog model="itco" action="none">
        <alias name="watchdog1"/>
      </watchdog>
      <memballoon model="virtio">
        <alias name="balloon0"/>
        <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
      </memballoon>
    </devices>
    

    VM definition remained same after VM stop-start

  17. added 2 commits that reference this issue on Jan 7, 2026
    d1d9890
    7a1f2e7
  18. DaanHoogland commented on Jan 9, 2026

    @DaanHoogland
    Contributor

    fixed in #11750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions