Skip to content

Commit

Permalink
docs: add usbdevice documentation
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 9, 2024
1 parent 1bf0dce commit 7a7d747
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions docs/advanced/addons/pcidevices.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
sidebar_position: 2
sidebar_label: PCI Devices
title: "PCI Devices"
sidebar_label: Devices Management
title: "Devices Management"
---

<head>
<link rel="canonical" href="https://docs.harvesterhci.io/v1.1/advanced/pcidevices"/>
</head>

## PCI Devices

_Available as of v1.1.0_

A `PCIDevice` in Harvester represents a host device with a PCI address.
Expand All @@ -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:

Expand All @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -94,4 +96,15 @@ 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

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.

### Limitations

0 comments on commit 7a7d747

Please sign in to comment.