Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1669424

Summary: Cannot passthrough a iscsi lun to vm as a hostdev device
Product: Red Hat Enterprise Linux 8 Reporter: yisun
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED CURRENTRELEASE QA Contact: yisun
Severity: high Docs Contact:
Priority: high    
Version: 8.0CC: hhan, jdenemar, jferlan, knoel, rbalakri, xuzhang, yisun
Target Milestone: rcKeywords: Automation, Regression
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-4.5.0-20.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1669586 1669966 (view as bug list) Environment:
Last Closed: 2019-06-14 01:03:09 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:    
Bug Blocks: 1669586, 1669966    

Description yisun 2019-01-25 08:26:51 UTC
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.

Comment 1 John Ferlan 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 5 yisun 2019-01-29 04:41:47 UTC
covered by auto jobs and result is PASS
versions:
libvirt	libvirt-4.5.0-20.module+el8+2724+8292f19c.x86_64
qemu-kvm	qemu-kvm-2.12.0-59.module+el8+2714+6d9351dd.x86_64
kernel	kernel-4.18.0-60.el8.x86_64

Related auto cases:
libvirt_scsi_hostdev..passthrough_iscsi_lun

Whole scsi hostdev test result:
https://libvirt-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/view/libvirt/view/RHEL-8.0%20x86_64/job/libvirt-RHEL-8.0-runtest-x86_64-function-scsi_hostdev/37/testReport/