one icon indicating copy to clipboard operation
one copied to clipboard

Cannot boot VM with more than one scsi disk

Open joergludwig opened this issue 7 years ago • 15 comments

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

joergludwig avatar Feb 20 '19 14:02 joergludwig

Fixed on 5.8.

sergiojvg avatar Feb 22 '19 23:02 sergiojvg

Thanks! :)

joergludwig avatar Feb 25 '19 14:02 joergludwig

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>

joergludwig avatar Mar 09 '19 16:03 joergludwig

we'll look into this, thanks for the feedback

tinova avatar Mar 26 '19 09:03 tinova

can you send us the output of "onevm show -x 21"?

tinova avatar Mar 26 '19 09:03 tinova

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:

onevm_show_208.xml.txt 208.log deployment.1.txt

joergludwig avatar Mar 26 '19 17:03 joergludwig

We have reproduced the issue.

sergiojvg avatar Apr 03 '19 22:04 sergiojvg

Need to figure out how to set target 0 if bus adapter is either "lsilogic" and "buslogic".

tinova avatar Apr 04 '19 14:04 tinova

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>

dealfonso avatar Apr 17 '19 08:04 dealfonso

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" ]

xorel avatar Sep 05 '19 15:09 xorel

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

joergludwig avatar Sep 09 '19 15:09 joergludwig

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...

dealfonso avatar Sep 10 '19 07:09 dealfonso

PRs:

  • one https://github.com/OpenNebula/one/pull/3709 to master
  • docs https://github.com/OpenNebula/docs/pull/762 to master

xorel avatar Sep 16 '19 12:09 xorel

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

scsi-xml

then the vm can success to create ,but when i enter into the guest os ,found the guest fail to start scsi-fail-4 scsi-fail-3 scsi-fail-2 scsi-fail-1

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 

scsi-test.log

k51312 avatar Jan 20 '20 08:01 k51312

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:

jirutka avatar Oct 26 '23 21:10 jirutka