Is it possible to attach a USB device to a VM?
Any OnApp with KVM HVs
This is unfortunately outside the scope of Support, and is a project that will be undertaken at one's own discretion.
Given that statement, here is some advice for making this happen:
You might want to take a look at this first and see if it works for you:
The 'virsh attach-device' would hopefully allow you to at least hotplug the device once the VM is up and running and the XML file should only need to be created once on the HV once the device is plugged in.
usb.xml file example:
<hostdev mode ‘subsystem’ type=’usb’>
Then run the command (with proper VM ID):
virsh attach-device vmserverID /path/to/usb.xml
It's also advised to disable auto updates and not to restart the VM.
For getting the HV to automatically create the file during boot and having it run the command automatically you can do something like the following:
For cloudboot HVs, you could add the file to ./rw/ so it would be available after each HV boot and could be referenced directly from there. For static HVs it should hang around as long as you don't put it in /onapp/config.
Regarding hotplugging automatically, probably the best I could suggest would be a cron job or similar that checks every 5 mins if the VM is running and if so checks if the usb disk is attached, and if not runs the 'virsh attach-device' command. Not pretty but may work for you.
If none of this works for you, you can contact our Professional Services team at email@example.com for a quote for a different solution.