<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 4, 2023 at 2:05 AM Tim Bell <<a href="mailto:Tim.Bell@cern.ch">Tim.Bell@cern.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 3 Jan 2023, at 20:03, Sean Mooney <<a href="mailto:smooney@redhat.com" target="_blank">smooney@redhat.com</a>> wrote:<br>
> <br>
> On Tue, 2023-01-03 at 14:54 +0000, Stephen Finucane wrote:<br>
>> On Mon, 2022-12-26 at 10:04 +0000, 韩光宇 wrote:<br>
>>> Hi, all<br>
>>> <br>
>>> I want to ask if openstack support USB passthrough now?<br>
>>> <br>
>>> Or if I want the instance to recognize the USB flash drive on the<br>
>>> host, do you have any suggestions?<br>
>>> <br>
>>> Thanks,<br>
>>> Han<br>
>> <br>
>> This isn't supported in nova and probably never will be. The closest you can get<br>
>> is to passthrough an entire USB controller as suggested by this blog [1], but<br>
>> that's really a hack and I 100% would not use it in production.<br>
> <br>
> ya so we have discussed usb passthough supprot a few times and its somethign nova could add but there has<br>
> neither been the demand or desire to add it stongly enough in the core team to actully do it.<br>
> <br>
> the shorted path to enableing usb passthoug would likely be to add support to cyborg and then add support for that ot nova.<br>
> i am perhaps the most open of the nova cores to supporting usb passthough since i have wanted to add it in the past but<br>
> if we were to support it it would have to be similar to howe we support pci passhtough. static provisioning and likely only of<br>
> stateless devices which rules out usb falsh drives.<br>
> <br>
> usb gps recivers for precision time stamping was one of the usecause raised in the past which we were somewhat open too<br>
> the other was usb programmers/debuggers forh cases when vms where used in industral test and automation workflows.<br>
> <br>
> as stephen said the only way to do it today is to piggyback on pci passthough and passhtough a usb contoller not a single device.<br>
> <br>
> if we were to ever support this in nova directly i would proably extend the pci tracker or support other buses like usb or use the generic<br>
> resouce table created for persistent memory to model the devices. in eitehr case we would want this capablity to be placement native from the<br>
> start if we added this capablity so it would be more and less work then you might imagine to do this right.<br>
> less work if we maintain the requirement for statless devices only (ie no usb flash drives) more if you also need to handel multi tenancy and<br>
> move operation include data copying, erasure and or encypetion.<br>
> <br>
> i would not expect this to change in the next few release unless multiple operators provide feedback that this is a broadly deired capablity.<br>
> with out a top level generic device api for mutple type of devices (vgpu, usb, pci) that was decoupled form the flaovr or an abstraction like<br>
> the cyborg device-profile or pci alias it is hard to see a clean way to model this in our api. that is why enabling it in cyborg and then extneding<br>
> nova ot support device profiles with a device type of usb is the simplar solution form a nova perspecitve but that is non trivial from an operational<br>
> perspective as you requrie cyborg to utilise the feature. doing it via a usb_alias in the flavor has all the draw backs of the pci_alias, static<br>
> configuration that must match on all compute nodes and futher proliferation of flavor explostion. this is one of the reasons we have not added this in<br>
> the past. the work to do it in the libvirt driver would not be hard but the maintaince and operational overhead of using it for operators is non<br>
> trivial.<br>
> <br>
>> <br>
>> Stephen<br>
>> <br>
>> [1] <a href="https://egallen.com/openstack-usb-passthrough/" rel="noreferrer" target="_blank">https://egallen.com/openstack-usb-passthrough/</a><br>
>> <br>
>> <br>
<br>
One intermedia option may be to use a usb over ip driver in the guest. I think we used this for one of our use cases (a license server with a dongle).<br>
<br>
Tim<br>
<br>
> <br>
> <br>
<br></blockquote><div><br></div><div>I didn't know such a thing existed! Are there any links or blog posts out there which are recommended?</div><div><br></div><div>Every time I've ever had to pass USB through to a VM, it was purely because of a hardware key for licensing.</div><div> </div></div></div>