[vfio-users] Using a physical disk in QEMU

Taiidan at gmx.com Taiidan at gmx.com
Thu Oct 26 09:12:44 UTC 2017


On 10/22/2017 06:57 AM, Torbjorn Jansson wrote:

> On 2017-10-22 02:18, Taiidan at gmx.com wrote:
>> Another option that would provide the best performance is attaching 
>> the drive to a SR-IOV capable HBA's VF and then using VFIO to attach 
>> the VF to your VM.
>>
>> The LSI SAS 2308 series is the most affordable choice for this at 
>> around $50-70 for an 8 internal port adapter (which can support up to 
>> 256 drives via expander cards)
>>
>
> a little off-topic for this thread but i'm curious how do sr-iov work 
> on raid controllers?
> do you assign drives or volumes via controller software that then 
> shows up as VFs? and that VF i assume appears like a disk by itself so 
> vm don't need to know much about it.
>
> i mean, not all drives/volumes can show up as VF since i bet host need 
> some drives to boot from too, right?
>
AFAIK (may vary per device firmware):
You use the usual raid controller gui to assign drives to a VF > assign 
the VF to a VM > VF appears as a controller with the drives or array 
attached to it just as it would had you used it bare metal with just 
those drives attached to it (instead of all the drives attached to it) 
the VF also doesn't know what other drives/arrays are on the actual 
controller.

It is more secure as well this way vs simply passing the whole 
controller, as with any quality SR-IOV device the configuration space is 
limited and you can't re-flash the device firmware from the VM's VF.

Not all devices support keeping a drive on the PF, check with OEM first 
if you want that feature (but I recommend using a fast PCI-e SSD for 
your boot disk anyways making that irrelevant)

If you only want a single VM with a RAID controller or HBA it provides 
higher security to use the VF instead of the whole controller.
If you want a max security setup for your VM's you would use one VF per 
controller and a PCI-e expansion system (ex: cyclone.com) so you can 
have many controllers (and space for more drives)

Please let me know if you have any more questions >:3




More information about the vfio-users mailing list