[libvirt-users] Fw: Error attaching tape drive device to KVM guest

Jake Kugel jkugel at us.ibm.com
Fri Jul 10 21:04:26 UTC 2015


A quick follow-up in case anyone else is trying to use IBM tape device 
within a KVM guest.  I didn't get SCSI passthrough below working, but 
there were two alternatives recommended to me:

(1)  Use PCI passthrough to give the KVM guest dedicated access to the 
Fibre Channel HBA PCI card.  PCI passthrough seems to be more solid.
(2)  Use ISCSI to share the tape devices and tape changer devices from 
physical host, and use ISCSI client on KVM guest to access.

We were successful using option 2 even though there is performance penalty 
for bridging with ISCSI.  It gives us greater flexibility, we don't have 
to dedicate a PCI card to the KVM guest.


----- Forwarded by jkugel us ibm com on 07/10/2015 01:50 PM -----

jkugel us ibm com wrote on 07/06/2015 10:23:45 AM:

> From: jkugel us ibm com
> To: libvirt-users at redhat.com
> Date: 07/06/2015 10:23 AM
> Subject: Error attaching tape drive device to KVM guest
> 
> Hello,
> 
> i'm trying to configure a host SCSI device (tape drive) so that it 
> is available in a KVM guest VM, but am receiving an error when 
> attempting to attach the device.  My guest xml has the following 
> scsi controller defined:
> 
> <controller type='scsi' index='0' model='virtio-scsi'>
>     <alias name='scsi0'/>
>     <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
> function='0x0'/>
> </controller>
> 
> I created tapedrive.xml with following contents:
> 
> <disk type='block' device='lun' sgio='unfiltered'>
>     <driver name='qemu' type='raw' cache='none'/>
>     <source dev='/dev/st0'/>
>     <target dev='st0' bus='scsi'/>
>     <address type='drive' controller='0' bus='0' target='0' unit='0'/>
> </disk>
> 
> I then attempt to attach using following command, and receive this 
error:
> 
> # virsh attach-device instance-0000002d tapedrive.xml --config
> error: Failed to attach device from tapedrive.xml
> error: internal error: Invalid harddisk device name: st0
> 
> Does anyone know cause of the error?  In <address> section of tape 
> drive definition I am using type='drive', I tried type='tape' also 
> but same error. is there a different property value I should use 
> here, or general advice for attaching tape drive to KVM guest?  Thanks, 
Jake




More information about the libvirt-users mailing list