Repository navigation
Extra lsilogic SCSI controller on aarch64 causes last disk unrecognized #12090
Copy link
Copy link
Closed
Copy link
Description
problem
Environment
- CloudStack Version: 4.20.1.0
- CPU Architecture: aarch64
- Hypervisor: KVM
- UEFI Configuration (relevant for aarch64 VM boot, from
/etc/cloudstack/agent/uefi.properties):
# CloudStack Agent UEFI Configuration for ARM64
# This file configures UEFI boot support for ARM64 virtual machines
# Secure boot mode with Microsoft keys
guest.nvram.template.secure=/usr/share/AAVMF/AAVMF_VARS.ms.fd
guest.loader.secure=/usr/share/AAVMF/AAVMF_CODE.ms.fd
# Secure boot mode without Microsoft keys
guest.nvram.template.secboot=/usr/share/AAVMF/AAVMF_VARS.fd
guest.loader.secboot=/usr/share/AAVMF/AAVMF_CODE.secboot.fd
# Standard UEFI mode (default)
guest.nvram.template.legacy=/usr/share/AAVMF/AAVMF_VARS.fd
guest.loader.legacy=/usr/share/AAVMF/AAVMF_CODE.fd
# No secure boot mode (explicitly disabled)
guest.nvram.template.nosecboot=/usr/share/AAVMF/AAVMF_VARS.fd
guest.loader.nosecboot=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd
# NVRAM storage path
guest.nvram.path=/var/lib/libvirt/qemu/nvram/
Problem Description
When attaching multiple disks to an aarch64 VM, CloudStack incorrectly adds an extra lsilogic SCSI controller after allocating virtio-scsi controllers for every 7 disks. This causes the last disk to be unrecognized after VM reboot.
Key Evidence: The second SCSI controller switches from virtio-scsi to lsilogic after reboot.
Reproduction Steps
- Deploy an aarch64 VM with 5 disks → all recognized correctly under
virtio-scsicontroller - Hot-add a 6th disk while VM running → temporarily works, creates second
virtio-scsicontroller - Shutdown and restart the VM → second controller becomes
lsilogic, 6th disk disappears
Expected Behavior
All disks assigned to virtio-scsi controllers, no lsilogic controller added.
Actual Behavior (with Evidence)
After reboot - WRONG
<controller type='scsi' index='1' model='lsilogic'>
Should be: <controller type='scsi' index='1' model='virtio-scsi'>Related Code
PR #9823 (bug at the end of implementation)
Attachments
Step 1: Initial State (5 disks attached)
root@NODE159:/var/log/cloudstack/agent# virsh dumpxml i-2-971-VM | grep controller
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
<address type='drive' controller='0' bus='0' target='0' unit='5'/>
<address type='drive' controller='0' bus='0' target='0' unit='6'/>
<controller type='usb' index='0' model='qemu-xhci'>
</controller>
<controller type='scsi' index='0' model='virtio-scsi'>
</controller>
<controller type='pci' index='0' model='pcie-root'>
</controller>
<controller type='virtio-serial' index='0'>
</controller>
<controller type='pci' index='1' model='pcie-root-port'>
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
</controller>
<controller type='pci' index='3' model='pcie-root-port'>
</controller>
<controller type='pci' index='4' model='pcie-root-port'>
</controller>
<controller type='pci' index='5' model='pcie-root-port'>
</controller>
<controller type='pci' index='6' model='pcie-root-port'>
</controller>
<controller type='pci' index='7' model='pcie-to-pci-bridge'>
</controller>
<controller type='pci' index='8' model='pcie-root-port'>
</controller>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
Step 2: Hot-add 6th disk while VM running,witch device id is 7
root@NODE159:/var/log/cloudstack/agent# virsh dumpxml i-2-971-VM | grep controller
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
<address type='drive' controller='0' bus='0' target='0' unit='5'/>
<address type='drive' controller='0' bus='0' target='0' unit='6'/>
<address type='drive' controller='1' bus='0' target='0' unit='0'/>
<controller type='usb' index='0' model='qemu-xhci'>
</controller>
<controller type='scsi' index='0' model='virtio-scsi'>
</controller>
<controller type='scsi' index='1' model='virtio-scsi'>
</controller>
<controller type='pci' index='0' model='pcie-root'>
</controller>
<controller type='virtio-serial' index='0'>
</controller>
<controller type='pci' index='1' model='pcie-root-port'>
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
</controller>
<controller type='pci' index='3' model='pcie-root-port'>
</controller>
<controller type='pci' index='4' model='pcie-root-port'>
</controller>
<controller type='pci' index='5' model='pcie-root-port'>
</controller>
<controller type='pci' index='6' model='pcie-root-port'>
</controller>
<controller type='pci' index='7' model='pcie-to-pci-bridge'>
</controller>
<controller type='pci' index='8' model='pcie-root-port'>
</controller>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
Step 3: Reboot VM
root@NODE159:/var/log/cloudstack/agent# virsh dumpxml i-2-971-VM | grep controller
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
<address type='drive' controller='0' bus='0' target='0' unit='5'/>
<address type='drive' controller='0' bus='0' target='0' unit='6'/>
<address type='drive' controller='1' bus='0' target='0' unit='0'/>
<controller type='usb' index='0' model='qemu-xhci'>
</controller>
<controller type='scsi' index='0' model='virtio-scsi'>
</controller>
<controller type='pci' index='0' model='pcie-root'>
</controller>
<controller type='scsi' index='1' model='lsilogic'> <!-- BUG: Should be virtio-scsi -->
</controller>
<controller type='virtio-serial' index='0'>
</controller>
<controller type='pci' index='1' model='pcie-root-port'>
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
</controller>
<controller type='pci' index='3' model='pcie-root-port'>
</controller>
<controller type='pci' index='4' model='pcie-root-port'>
</controller>
<controller type='pci' index='5' model='pcie-root-port'>
</controller>
<controller type='pci' index='6' model='pcie-root-port'>
</controller>
<controller type='pci' index='7' model='pcie-to-pci-bridge'>
</controller>
<controller type='pci' index='8' model='pcie-root-port'>
</controller>
<address type='virtio-serial' controller='0' bus='0' port='1'/>
root@NODE159:/var/log/cloudstack/agent# versions
- CloudStack Version: 4.20.1.0
- CPU Architecture: aarch64
- Hypervisor: KVM
The steps to reproduce the bug
1.Initial State 5 disks attached
2.Hot-add 6th disk while VM running
3.reboot VM
...
What to do about it?
No response
Reactions are currently unavailable
Activity
gw769 commentedon Nov 26, 2025
Hi all,
I've found a temporary workaround for this issue (see #12090) using CloudStack's libvirt VM XML transformation hook. Here's the properly formatted details:
Workaround Approach
Use the
libvirt-vm-xml-transformer.groovyhook to force-inject 4 persistentvirtio-scsicontrollers (index=1~4) into the VM's XML. This prevents the unwantedlsilogiccontroller from being added after reboot.Steps to Apply
Create/Update the Hook File
Create/overwrite the hook at:
Add the Workaround Script
Paste this code (properly wrapped in a Groovy code block):
Verification
After applying:
virsh dumpxml <VM_NAME> | grep controllermodel='virtio-scsi'(no morelsilogic), and all disks remain recognized.kiranchavala commentedon Dec 23, 2025
@gw769 Could you please let us know the vm guest os type (windows or linux )
Also can you provide the root disk controller details of the vm
gw769 commentedon Dec 23, 2025
Hi,
Thanks for checking. Quick details:
Let me know if you need anything else.
kiranchavala commentedon Dec 23, 2025
Thanks @gw769
cc @DaanHoogland @vishesh92
Able to reproduce the issue even on a KVM amd64 host
Check the dumpxml on the kvm host
The sixth disk get the bus driver as "virtio"
[-][CloudStack 4.20.1.0]Extra lsilogic SCSI controller on aarch64 causes last disk unrecognized[/-][+]Extra lsilogic SCSI controller on aarch64 causes last disk unrecognized[/+]kvm: honour data disk controller for vm during attach volume
shwstppr commentedon Jan 16, 2026
While I created #12452 but I think there could be two issues.
In @gw769 's case, dataDiskController is not specified for the VM but @kiranchavala reproduced the somewhat similar behaviour with amd64 while specifying a dataDiskController. I'll try to check for aarch64 if #12452 solves the issue
abh1sar commentedon Feb 4, 2026
Fixed by #12452