Nova/USB controller hot cold plug
< Nova
Contents
USB controller hot/cold plug features
Related Content
https://wiki.openstack.org/wiki/Nova/USB_device%26USB_controller https://wiki.openstack.org/wiki/Nova/USB_device_hot_cold_plug
Background
Add usb controller is a necessary supplement function for usb-passthrough.
User scenarios
1. When a user wants to copy mass data to a removable media for business trip him may want to use usb data disk. But for high speed, he should first create a ehci usb controller for usb device.
Technical verification
1. Test case
Add different type usb controller to vm when vm in diffrent status(running, stopped and so on).
2. Xml definition and commands
(1)Sample of usb controller: <controller type='usb' index='6' model='nec-xhci'/> (2)Sample of add usb controller: virsh attach-device test ehci.xml --config (3)Sample of remove usb controller: virsh detach-device test ehci.xml --config
3. The test results
(1)It only supports adding usb controllers to vm or removing controllers from vm when vm in stopped status. (2)Different usb controllers should have uniquet index property.
Proposed solution
1. Use cases
Case 1: (1)Admin/User request to add usb controllers(type) to a vm. (2)System first validates usb controller arguments and vm's status, if valid then create usb controllers. Note: I can't find requirement for removing usb controller by now.
2. System requirements and things should be considered(An optional Implementation):
(1)System supports creating usb controllers. The API may like: Post v2/{tenant_id}/servers/{server_id}/action { "attach_usb_controller": { "type": "ehci", "count": 2, } } The usb controller information can be stored as "usb_controller_requests":"" in instance_system_metadata.