Bug 1270581

Summary: [RFE] Hostdev_passthrough: support SCSI FC tape device
Product: [oVirt] ovirt-engine Reporter: Nisim Simsolo <nsimsolo>
Component: RFEsAssignee: Martin Polednik <mpoledni>
Status: CLOSED CURRENTRELEASE QA Contact: Nisim Simsolo <nsimsolo>
Severity: medium Docs Contact:
Priority: high    
Version: ---CC: amureini, bugs, gklein, lsurette, mavital, melewis, mgoldboi, michal.skrivanek, nsimsolo, rbalakri, Rhev-m-bugs, rhodain, sbonazzo, srevivo, tjelinek, ykaul
Target Milestone: ovirt-4.0.0-betaKeywords: FutureFeature
Target Release: 4.0.0Flags: rule-engine: ovirt-4.0.0+
gklein: testing_plan_complete+
mgoldboi: planning_ack+
tjelinek: devel_ack+
mavital: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Previously, Red Hat Virtualization only allowed hostdev passthrough of USB and PCI devices. To assign storage cards directly to a virtual machine users had to assign the whole adapter as PCI device. The problem with this approach is that PCI passthrough has specific hardware requirements. This feature allows administrators to passthrough a LUN directly to a virtual machine, allowing for full set of SG commands. This means tapes, changers, and anything speaking SCSI protocol can be assigned directly without specific hardware requirements with the exception of assigned device itself.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-05 07:39:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1301104    
Bug Blocks: 1097653, 1416027    
Attachments:
Description Flags
engine.log
none
vdsm.log
none
libvirt XML none

Description Nisim Simsolo 2015-10-11 12:24:23 UTC
Description of problem:
Trying to run VM with emulated scsi tape device (https://bugzilla.redhat.com/show_bug.cgi?id=1103739#c10) attached, failed with the next event:
"VM rhel7_amd_cuda is down with error. Exit message: XML error: 'bus', 'target', and 'unit' must be specified for scsi hostdev source address."

Version-Release number of selected component (if applicable):
rhevm-3.6.0-0.18.el6
vdsm-4.17.8-1.el7ev.noarch
qemu-kvm-rhev-2.3.0-24.el7.x86_64
sanlock-3.2.4-1.el7.x86_64
libvirt-client-1.2.17-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create emulated scsi tape device on host (from bug https://bugzilla.redhat.com/show_bug.cgi?id=1103739#c10 comment):
- Install scsi-target-utils, iscsi-initiator-utils and lsscsi on host.
- Prepare the emulate scsi tape device. 
# modprobe sg
# service tgtd start
# tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.st:tape:sttarget1 
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL 
# dd if=/dev/zero of=/root/tape.device bs=1M count=100 
t# gtadm --lld iscsi --op new --mode logicalunit --tid 1 --device-type tape --lun 1 -b /root/tape.device
# tgtadm --lld iscsi --op show --mode target
# iscsiadm -m discovery -t st -p 127.0.0.1 127.0.0.1:3260,1 
# iqn.st:tape:sttarget1
# iscsiadm -m node -l
- Verify login successful.
- Verify virtual tape attached:
# lsscsi | grep -w tape
# cat /proc/scsi/scsi 

2. From webadmin Refresh host capabilities and attach host emulated device to VM.
3. Try to run VM.

Actual results:
VM failed to run and the next event logged: 
VM rhel7_amd_cuda is down with error. Exit message: XML error: 'bus', 'target', and 'unit' must be specified for scsi hostdev source address.

Expected results:
VM should run with wmulated device attached to it.

Additional info:
engine.log and vdsm.log attached.

Comment 1 Nisim Simsolo 2015-10-11 12:25:12 UTC
Created attachment 1081792 [details]
engine.log

Comment 2 Nisim Simsolo 2015-10-11 12:26:04 UTC
Created attachment 1081793 [details]
vdsm.log

Comment 3 Yaniv Kaul 2015-10-12 05:50:05 UTC
Nisim, I assume libvirt's XML is the interesting part here. Can you copy-paste the relevant part (which is probably missing some data)?

Comment 4 Nisim Simsolo 2015-10-12 06:55:03 UTC
Attaching libvirt XML file.

Comment 5 Nisim Simsolo 2015-10-12 06:55:30 UTC
Created attachment 1081897 [details]
libvirt XML

Comment 6 Martin Polednik 2015-10-12 09:41:14 UTC
Only VFIO (as in PCI) and USB passthrough were targeted at 3.6. SCSI passthrough is absent so the XML cannot be constructed at all unless the SCSI controller is used (but that is a PCI device - not SCSI).

Comment 7 Red Hat Bugzilla Rules Engine 2015-11-16 14:11:20 UTC
This bug is flagged for 3.6, yet the milestone is for 4.0 version, therefore the milestone has been reset.
Please set the correct milestone or add the flag.

Comment 8 Michal Skrivanek 2016-01-22 15:27:01 UTC
this is an RFE to support SCSI passthrough (not PCI VFIO passthrough)

Comment 13 Sandro Bonazzola 2016-05-02 09:49:11 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 14 Nisim Simsolo 2016-06-16 15:12:46 UTC
Verified:
ovirt-engine-4.1.0-0.0.master.20160613231338.git6e72c0b.el7.centos.noarch
qemu-kvm-rhev-2.3.0-31.el7_2.15.x86_64
vdsm-4.18.999-80.git843444f.el7.centos.x86_64
libvirt-daemon-1.2.17-13.el7_2.5.x86_64
sanlock-3.2.4-2.el7_2.x86_64

Verification test case added to external trackers.

Comment 15 Sandro Bonazzola 2016-07-05 07:39:59 UTC
oVirt 4.0.0 has been released, closing current release.