Cannot boot VM with more than one scsi disk
Description Booting a VM with more than one scsi disk stops with an error message. The error occurs with adapter "lsilogic" and "buslogic". VMs with one scsi disk work. VMs with multiple virtio disks work as well. We need scsi disks for trim support.
/var/log/one/oned.log:
LOG I 21 error: unsupported configuration: target must be 0 for controller model 'lsilogic'
Error shown in Sunstone:
Error deploying virtual machine: Could not create domain from /var/lib/one//datastores/0/21/deployment.20
Extract of /var/lib/one/datastores/0/21/deployment.20:
<disk type='file' device='cdrom'>
<source file='/var/lib/one//datastores/0/21/disk.0'/>
<target dev='sda'/>
<boot order='2'/>
<readonly/>
<driver name='qemu' type='raw' cache='none'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/21/disk.4'/>
<target dev='sdb'/>
<driver name='qemu' type='qcow2' cache='none'/>
<address type='drive' controller='0' bus='0' target='1' unit='0'/>
</disk>
To Reproduce Create a VM, add two scsi disks, boot. We have the machine type set to "q35" globally.
Expected behavior VM should boot.
Details
- Affected Component: Scheduler or Storage
- Hypervisor: KVM
- Version: 5.6.1-1
- Machine: q35
- Architecure: x86_64
Additional context We think, the problem was introduced here: https://github.com/OpenNebula/one/commit/e164fde85f4459add2e8007ebcf15da5d045d514
See also: https://github.com/libvirt/libvirt/blob/master/src/qemu/qemu_command.c#L5103
Progress Status
- [ ] Branch created
- [ ] Code committed to development branch
- [ ] Testing - QA
- [ ] Documentation
- [ ] Release notes - resolved issues, compatibility, known issues
- [ ] Code committed to upstream release/hotfix branches
- [ ] Documentation committed to upstream release/hotfix branches
Fixed on 5.8.
Thanks! :)
Still exactly the same problem in OpenNebula 5.8.0-1. I even rebooted the server and set machine type back to "pc" just to be sure.
/var/log/one/oned.log:
LOG I 21 error: unsupported configuration: target must be 0 for controller model 'lsilogic'
Extract of /var/lib/one/datastores/0/21/deployment.31:
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/21/disk.1'/>
<target dev='sda'/>
<boot order='1'/>
<driver name='qemu' type='qcow2' cache='none' discard='unmap'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/21/disk.4'/>
<target dev='sdb'/>
<driver name='qemu' type='qcow2' cache='none' discard='unmap'/>
<address type='drive' controller='0' bus='0' target='1' unit='0'/>
</disk>
we'll look into this, thanks for the feedback
can you send us the output of "onevm show -x 21"?
As my VM 21 created hundreds of pages of xml output, I created a new clean VM with two scsi disks to show the problem:
We have reproduced the issue.
Need to figure out how to set target 0 if bus adapter is either "lsilogic" and "buslogic".
Hi, same error here...
The deployment file that ONE has created is (but it does not work)
...
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/33153/disk.0'/>
<target dev='sda'/>
<driver name='qemu' type='qcow2' cache='none'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/33153/disk.1'/>
<target dev='sdb'/>
<driver name='qemu' type='raw' cache='none'/>
<address type='drive' controller='0' bus='0' target='1' unit='0'/>
</disk>
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/33153/disk.2'/>
<target dev='sdc'/>
<driver name='qemu' type='raw' cache='none'/>
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
...
If I move the value in "target" to "unit", it works (and also the units are properly mapped in the VM, as reported in sunstone)
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/33153/disk.0'/>
<target dev='sda'/>
<driver name='qemu' type='qcow2' cache='none'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/33153/disk.1'/>
<target dev='sdb'/>
<driver name='qemu' type='raw' cache='none'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type='file' device='disk'>
<source file='/var/lib/one//datastores/0/33153/disk.2'/>
<target dev='sdc'/>
<driver name='qemu' type='raw' cache='none'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk>
I can't reproduce the issues. Can you verify you have virtio_scsi_queues enabled? Either globaly in vmm_exec_kvm.conf or in VM Template
FEATURES = [
VIRTIO_SCSI_QUEUES = "1" ]
Perfect, this option fixes our issue. Thank you very much!
Is there a reason, it is not enabled by default? https://github.com/OpenNebula/one/blob/master/src/vmm_mad/exec/vmm_exec_kvm.conf#L35
Hi, that option also fixes the issue here. it is a weird behavior if not enabled. Where is it documented? I have noticed that such option is not available in older releases...
PRs:
- one https://github.com/OpenNebula/one/pull/3709 to master
- docs https://github.com/OpenNebula/docs/pull/762 to master
hi, i have a trouble in create vm with scsi disk, for the guest os can't start
[root@NSG ~]# virsh list --all Id Name State
2 root-vsys_scsi-vm1 running
[root@NSG ~]# virsh dumpxml root-vsys_scsi-vm1

then the vm can success to create ,but when i enter into the guest os ,found the guest fail to start

my centos7 kernel: linux-3.10.0-693.17.1.el7.x86_64 ,this kernel has reduced lots of parameters. this mybe my host kernel .config has some problem, how should i config my kernel .config ??
thanks
Fixed on 5.8.
@sergiojvg, no, it’s not fixed at all. I’m experiencing the same issue even on OpenNebula 6.6.0! :angry: