Realize the support of instance to usb device, that is, add, delete, change and check the function of usb device.

Registered by wang

1. show the host's usb device:expand the interface of nova- API, and provide an API entry.For convenience, you can add an action to trigger the interface by calling /os-hypervisors/{host_name}/get_host_usblist by **GET**. The following code adds an API interface, which needs to be called by **GET** request.The code manager.py is modified in compute-manager to call libvirt to drive and filter out the system's own devices.Add the code in host (virsh nodedev-list,virsh nodedev-dumpxml ${usb}) to list all usb devices.

2: attach_usb: call API interface, input vendor and product values, call compute.Manager. Attach_usb method, call driver.py to modify conf file to increase vendor and product values, call nova/objects/ instance_usb.instanceusb.create (), and save data to instance_usb table.

3: detach_usb: with attach_usb.

4: show_usb: show the usb that has been mounted to the virtual machine,call API interface, input server_id, call nova/objects/ instance_usb.instanceusb.get_with_instance_uuid () method, data will be returned to the data, through the CONF

Note:
Rebuild, resize, delete, migrate/live-migrate, and evacuate for virtual machines will result in the loss of the usb and will need to be modified as well.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
wang
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

API:
1./os-hypervisors/{host_ID}/get_host_usblist
2./servers/{server_id}/os-usb_attachment
{
  "usbAttachment":
  {
    "vendor": "***"
    "product": "***"
  }
}
3./servers/{server_id}/os-usb_attachment/{vendor_id}/{product_id}
4./servers/{server_id}/os-usb_attachment

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.