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:
The ability to connect to multiple storage devices
A standard command set
Standard device naming to simplify migrations
Device pass-through
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
<controller type='scsi' model='virtio-scsi' index='1'/>
The XML file in this example is named ctlr.xml
.
# virsh attach-device guest1 ctlr.xml --config
<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
.
# virsh attach-device guest1 disk.xml --config