Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1669966

Summary: Cannot passthrough a iscsi lun to vm as a hostdev device
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Jiri Denemark <jdenemar>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: yisun
Severity: high Docs Contact:
Priority: high    
Version: 8.0CC: dyuan, jdenemar, jsuchane, rbalakri, xuzhang
Target Milestone: rcKeywords: Automation, Regression
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-5.0.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1669424 Environment:
Last Closed: 2019-05-29 16:05:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1669424    
Bug Blocks: 1669586    

Description Jiri Denemark 2019-01-28 08:59:41 UTC
+++ This bug was initially created as a clone of Bug #1669424 +++

Description:
Cannot passthrough a iscsi lun to vm as a hostdev device

Versions:
libvirt-4.5.0-17 till latest version

How reproducible:
100%

This is a regression between libvirt-4.5.0-16 and libvirt-4.5.0-17

Steps:
1. prepared a iscsi lun (127.0.0.1:3260, iqn=iqn.2016-03.com.virttest:logical-pool.target)
2. use it as hostdev in vm (on libvirt-4.5.0-16) and vm can be started
[root@dell-per730-67 x86_64]# rpm -qa | grep libvirt-4
libvirt-4.5.0-16.module+el8+2603+0a5231c4.x86_64

[root@dell-per730-67 x86_64]# virsh dumpxml avocado-vt-vm1 | grep /hostdev -B5
    <hostdev mode='subsystem' type='scsi' managed='no'>
      <source protocol='iscsi' name='iqn.2016-03.com.virttest:logical-pool.target/0'>
        <host name='127.0.0.1' port='3260'/>
      </source>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>

[root@dell-per730-67 x86_64]# virsh start avocado-vt-vm1
Domain avocado-vt-vm1 started

3. upgrade libvirt to libvirt-4.5.0-17
[root@dell-per730-67 x86_64]# cd /tmp/download.eng.bos.redhat.com/brewroot/vol/rhel-8/packages/libvirt/4.5.0/17.module+el8+2637+096d5272/
[root@dell-per730-67 x86_64]# yum localinstall libvirt* -y
[root@dell-per730-67 x86_64]# service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service
[root@dell-per730-67 x86_64]# rpm -qa | grep libvirt-4
libvirt-4.5.0-17.module+el8+2637+096d5272.x86_64

4. try to start the vm again
[root@dell-per730-67 x86_64]# virsh destroy avocado-vt-vm1
Domain avocado-vt-vm1 destroyed

[root@dell-per730-67 x86_64]# virsh dumpxml avocado-vt-vm1 | grep /hostdev -B5
    <hostdev mode='subsystem' type='scsi' managed='no'>
      <source protocol='iscsi' name='iqn.2016-03.com.virttest:logical-pool.target/0'>
        <host name='127.0.0.1' port='3260'/>
      </source>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>


[root@dell-per730-67 x86_64]# virsh start avocado-vt-vm1
error: Failed to start domain avocado-vt-vm1
error: internal error: Cannot parse adapter ''


Expected result:
The vm can be started

Actual result:
VM cannot start due to above error.

--- Additional comment from John Ferlan on 2019-01-25 17:02:40 UTC ---

Sigh, yet more fallout from the changes for bz1656362. So much for low risk with this being the second issue (the other being bz1666605).

This time, the neglected piece of the puzzle was that qemuGetHostdevPath expects to operate on a SCSI hostdev and not a SCSI hostdev using the iSCSI protocol.

Comment 3 yisun 2019-02-21 11:42:50 UTC
Covered by auto cases:
libvirt_scsi_hostdev..passthrough_iscsi_lun

Result is: PASSED

Related packages:
libvirt	libvirt-5.0.0-3.module+el8+2807+8bbe0a41.x86_64
qemu-kvm	qemu-kvm-3.1.0-15.module+el8+2792+e33e01a0.x86_64
kernel	kernel-4.18.0-67.el8.x86_64
selinux-policy	selinux-policy-3.14.1-59.el8.noarch
systemd	systemd-239-11.el8.x86_64
dnsmasq	dnsmasq-2.79-4.el8+8.x86_64

Comment 5 errata-xmlrpc 2019-05-29 16:05:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:1293