Jump to: navigation, search

Nova/USB device hot cold plug

< Nova
Revision as of 09:20, 4 March 2014 by Yj.yuan@huawei.com (talk | contribs) (Technical verification)

USB device hot/cold plug features

Related Content

https://wiki.openstack.org/wiki/Nova/USB_device%26USB_controller

https://wiki.openstack.org/wiki/Nova/USB_controller_hot_cold_plug

Background

Adding usb devices to a exist vm is a necessary supplement features to usb device passthrough.

User scenarios

When a user transfers money online, him may need to attach a usb-key provided by bank to vm for authentication.

Technical verification

1. Test case

   (1)Attaching different type and number usb controllers and usb devices to vm when vm in diffrent status(running, stopped and so on).
   (2)Detaching usb devices from vm when vm in diffrent status(running, stopped and so on).

2. Xml definition

   (1)Sample of usb controller:
  <controller type='usb' index='2' model='piix3-uhci'/>
  <controller type='usb' index='1' model='ehci'/>
  (2)Sample of pass-through usb devices
  <hostdev mode='subsystem' type='usb'>
   < source>
    <vendor id='0x136b'/>
    <product id='0x0003'/>
    <address bus='2' device='2'/>
   </source>
   <address type='usb' bus='1' port='1'/>
  </hostdev>
  (3)Command of adding usb controller:
       virsh attach-device vm usb.xml --config
       virsh attach-device vm usb.xml
  (4)Command of removing usb controller:
       virsh detach-device vm usb.xml --config
       virsh detach-device vm usb.xml

3. The test results

   (1)It supports attaching usb device to vm or removing usb device from vm when vm in stopped status, just modify vm xml configuration.
   (2)It supports attaching usb device to vm or removing usb device from vm when vm in running/suspended status, not only modify vm xml configuration but apply changes to guest os.

Proposed solution

1. Use cases

2. System requirements and things should be considered(An optional Implementation):