diff --git a/docs/advanced/addons/pcidevices.md b/docs/advanced/addons/pcidevices.md index 53f9d8de4ab..55324b17617 100644 --- a/docs/advanced/addons/pcidevices.md +++ b/docs/advanced/addons/pcidevices.md @@ -1,13 +1,15 @@ --- sidebar_position: 2 -sidebar_label: PCI Devices -title: "PCI Devices" +sidebar_label: Device Management +title: "Device Management" --- +## PCI Devices + _Available as of v1.1.0_ A `PCIDevice` in Harvester represents a host device with a PCI address. @@ -24,7 +26,7 @@ To use the PCI devices feature, users need to enable the `pcidevices-controller` Once the `pcidevices-controller` addon is deployed successfully, it can take a few minutes for it to scan and the PCIDevice CRDs to become available. ![](/img/v1.2/pcidevices/PcideviceEnabled.png) -## Enabling Passthrough on a PCI Device +### Enabling Passthrough on a PCI Device 1. Now go to the `Advanced -> PCI Devices` page: @@ -47,7 +49,7 @@ Once the `pcidevices-controller` addon is deployed successfully, it can take a f ![](/img/v1.2/pcidevices/enable-pcidevices-done.png) -## Attaching PCI Devices to a VM +### Attaching PCI Devices to a VM After enabling these PCI devices, you can navigate to the **Virtual Machines** page and select **Edit Config** to pass these devices. @@ -58,12 +60,12 @@ Select **PCI Devices** and use the **Available PCI Devices** drop-down. Select t ![](/img/v1.2/pcidevices/vm-pcidevices-attach.png) -## Using a passed-through PCI Device inside the VM +### Using a passed-through PCI Device inside the VM Boot the VM up, and run `lspci` inside the VM, the attached PCI devices will show up, although the PCI address in the VM won't necessarily match the PCI address in the host. -## Installing drivers for your PCI device inside the VM +### Installing drivers for your PCI device inside the VM This is just like installing drivers in the host. The PCI passthrough feature will bind the host device to the `vfio-pci` driver, which gives VMs the ability to use their own drivers. [Here is a screenshot](https://tobilehman.com/posts/suse-harvester-pci/#toc) of NVIDIA drivers being installed in a VM. It includes a CUDA example that proves that the device drivers work. @@ -94,4 +96,51 @@ 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) \ No newline at end of file +![](/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, please see [reference](https://github.com/kubevirt/kubevirt/issues/11979). \ No newline at end of file diff --git a/static/img/v1.4/usbdevices/attach-vm.png b/static/img/v1.4/usbdevices/attach-vm.png new file mode 100644 index 00000000000..8f343e12165 Binary files /dev/null and b/static/img/v1.4/usbdevices/attach-vm.png differ diff --git a/static/img/v1.4/usbdevices/enable-done.png b/static/img/v1.4/usbdevices/enable-done.png new file mode 100644 index 00000000000..8a8d312cfbd Binary files /dev/null and b/static/img/v1.4/usbdevices/enable-done.png differ diff --git a/static/img/v1.4/usbdevices/index.png b/static/img/v1.4/usbdevices/index.png new file mode 100644 index 00000000000..2b55b5a1a7f Binary files /dev/null and b/static/img/v1.4/usbdevices/index.png differ diff --git a/static/img/v1.4/usbdevices/search.png b/static/img/v1.4/usbdevices/search.png new file mode 100644 index 00000000000..7ed04f2ef52 Binary files /dev/null and b/static/img/v1.4/usbdevices/search.png differ diff --git a/static/img/v1.4/usbdevices/select.png b/static/img/v1.4/usbdevices/select.png new file mode 100644 index 00000000000..865a8a8d9e7 Binary files /dev/null and b/static/img/v1.4/usbdevices/select.png differ diff --git a/static/img/v1.4/usbdevices/usb-in-vm.png b/static/img/v1.4/usbdevices/usb-in-vm.png new file mode 100644 index 00000000000..86a661b4d4d Binary files /dev/null and b/static/img/v1.4/usbdevices/usb-in-vm.png differ