Bug 1808390

Summary: [RHEL-AV-8.2 libvirt] Unable to start a VM with a Tape Library passed through from the hypervisor
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Andrea Bolognani <abologna>
Component: libvirtAssignee: Andrea Bolognani <abologna>
Status: CLOSED ERRATA QA Contact: gaojianan <jgao>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: hhan, jdenemar, jsuchane, lmen, mtessun, virt-maint, xuzhang
Target Milestone: rcKeywords: Regression
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-6.0.0-9.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-05 09:57:51 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: 1808400    

Description Andrea Bolognani 2020-02-28 11:46:27 UTC
This bug was initially created as a copy of Bug #1754241

I am copying this bug because:

  The bug has been addressed in RHEL 7.8 with downstream-only patches

    libvirt-RHEL-virscsi-Introduce-and-use-virSCSIDeviceGetUnprivSGIOSysfsPath.patch
    libvirt-RHEL-qemuSetUnprivSGIO-Actually-use-calculated-sysfs_path-to-set-unpriv_sgio.patch

  but these patches are absent from RHEL AV 8.2, which means someone
  moving from the former to the latter will see a regression.

Description of problem:

After attaching a tape library to a VM as described at the official documentation [1], the VM fails to start.

Version-Release number of selected component (if applicable):
OS Version:
RHEL - 7.7 - 3.el7ev
OS Description:
Red Hat Virtualization Host 4.3.5 (el7.7)
Kernel Version:
3.10.0 - 1062.el7.x86_64
KVM Version:
2.12.0 - 33.el7
LIBVIRT Version:
libvirt-4.5.0-23.el7
VDSM Version:
vdsm-4.30.24-2.el7ev
SPICE Version:
0.14.0 - 7.el7
GlusterFS Version:
glusterfs-3.12.2-47.2.el7rhgs
CEPH Version:
librbd1-10.2.5-4.el7
Open vSwitch Version:
openvswitch-2.11-4.el7ev
Kernel Features:
PTI: 1, IBRS: 0, RETP: 1, SSBD: 3
VNC Encryption:
Disabled

How reproducible:
Always

Steps to Reproduce:
1.Attach a tape library to a VM as described in the documentation [1]
2.Try to start the VM

Actual results:
The VM fails to start

Expected results:
The VM starts successfully

Comment 9 gaojianan 2020-03-12 07:16:59 UTC
Verified on 
libvirt-6.0.0-9.virtcov.el8.x86_64

Step:
1.Prepare a tape class scsi device
# lshw -c tape -businfo
Bus info          Device      Class          Description
========================================================
scsi@8:0.0.0      /dev/nst0   tape           scsi_debug


2.Edit guest xml and start the guest with the following xml:
 
    <hostdev mode='subsystem' type='scsi' managed='no'>        
      <source>
        <adapter name='scsi_host8'/>
        <address bus='0' target='0' unit='0'/>
      </source>
    </hostdev>

# virsh start test1
Domain test1 started

3.Log in to the guest to check the device:
# lsscsi
[0:0:0:0]    tape    Linux    scsi_debug       0188  /dev/st0 


Work as expected

Comment 11 errata-xmlrpc 2020-05-05 09:57:51 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-2020:2017