Skip to content

Commit

Permalink
docs: add usbdevices
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Yu <jack.yu@suse.com>
  • Loading branch information
Yu-Jack committed Sep 13, 2024
1 parent 1bf0dce commit 77eefa1
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion docs/advanced/addons/pcidevices.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,54 @@ We have also introduced a new filter to help you filter PCI devices by the under
![](/img/v1.2/pcidevices/SriovNetworkDevicesFilter.png)

The newly created PCI device can be passed through to virtual machines like any other PCI device.
![](/img/v1.2/pcidevices/SriovNetworkDevicesFilterResult.png)
![](/img/v1.2/pcidevices/SriovNetworkDevicesFilterResult.png)

## USB Devices

_Available as of v1.4.0_

A `USBDevice` in Harvester represents a USB device **on the node.** This is accomplished by using the `pcidevices-controller` addon.

The devices can be passed through the hypervisor to a VM by creating a `USBDeviecClaim` resource, or by using the UI to enable passthrough. Passing a device through the hypervisor means that the VM can directly access the device, and effectively owns the device.

It's slightly different from PCI Devices. For example, we have a USB Controller with four USB ports. We'll get a full control by creating `PCIDeviceClaim`. However, we can also get one USB port by creating `USBDeviceClaim`. The rest of USB ports are still available to the node.

### Enabling Passthrough on a USB Device

1. Now go to the `Advanced -> USB Devices` page:

![](/img/v1.4/usbdevices/index.png)

1. Search for your device by any keywords.

![](/img/v1.4/usbdevices/search.png)

1. Select the devices you want to enable for passthrough:

![](/img/v1.4/usbdevices/select.png)

1. Then click **Enable Passthrough** and read the warning message. If you still want to enable these devices, click **Enable** and wait for all devices to be `Enabled`.

![](/img/v1.4/usbdevices/enable-done.png)

### Attaching USB Devices to a VM

After enabling these USB devices, you can navigate to the **Virtual Machines** page to create a new virtual machine or click **Edit Config** of existing virtual machine.

Select **USB Devices** and use the **Available USB Devices** drop-down. Select the devices you want to attach from the list displayed and then click **Save**.

![](/img/v1.4/usbdevices/attach-vm.png)

### Using a passed-through USB Device inside the VM

Boot the VM up, and run `lsusb` inside the VM, the attached USB devices will show up.

![](/img/v1.4/usbdevices/usb-in-vm.png)

### Limitations

1. Don't support live migration since USB device is bound to the specified node.
2. Don't support hot plug and replugging, please see [reference](https://github.com/kubevirt/kubevirt/issues/11979).
3. Require re-creating a USBDeviceClaim to enable the USB device if device path changes in following situations:
- Re-plugging USB device.
- Rebooting the node.
Binary file added static/img/v1.4/usbdevices/attach-vm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/v1.4/usbdevices/enable-done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/v1.4/usbdevices/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/v1.4/usbdevices/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/v1.4/usbdevices/select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/v1.4/usbdevices/usb-in-vm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 77eefa1

Please sign in to comment.