Mapping devices using the virtio-scsi interface

In Red Hat Enterprise Linux (RHEL) 6 Update 4 onwards, devices can be mapped to the guest through the virtio-scsi interface, replacing the virtio-blk device and providing the following improvements:

Note:

Mapping using paths is also supported with the virtio-scsi interface.

To enable SCSI passthrough and use the exported disks as bare-metal SCSI devices inside the guest, the <disk> element's device attribute must be set to "lun" instead of "disk". The following disk XML file provides an example of the device attribute's value for virtio-scsi:

<disk type='block' device='lun' sgio='unfiltered'>
<driver name='qemu' type='raw' cache='none'/>
<source dev='/dev/disk/by-path/pci-0000:07:00.1-fc-0x5001438011393dee-lun-1'/>
<target dev='sdd' bus='scsi'/>
<address type='drive' controller='4' bus='0' target='0' unit='0'/>
</disk>

To map one or more devices using virtio-scsi

  1. Create one XML file for each SCSI controller, and enter the following content into the XML files:
    <controller type='scsi' model='virtio-scsi' index='1'/>

    The XML file in this example is named ctlr.xml.

  2. Attach the SCSI controllers to the guest:
    # virsh attach-device guest1 ctlr.xml --config
  3. Create XML files for the disks, and enter the following content into the XML files:
    <disk type='block' device='lun' sgio='unfiltered'>
    <driver name='qemu' type='raw' cache='none'/>
    <source dev='/dev/disk/by-path/pci-0000:07:00.1-fc-0x5001438011393dee-lun-1'/>
    <target dev='sdd' bus='scsi'/>
    <address type='drive' controller='1' bus='0' target='0' unit='0'/>
    </disk>

    The XML file in this example is named disk.xml.

  4. Attach the disk to the existing guest:
    # virsh attach-device guest1 disk.xml --config