9.18.10. Configuring USB host passthrough


As a cluster administrator, you can expose USB devices in a cluster, which makes the devices available for virtual machine (VM) owners to assign to VMs. Enabling this passthrough of USB devices allows a VM to connect to USB hardware that is attached to an OpenShift Container Platform node, as if the hardware and the VM are physically connected.

To expose a USB device, first enable host passthrough and then configure the VM to use the USB device.

9.18.10.1. Enabling USB host passthrough

To attach a USB device to a virtual machine (VM), you must first enable USB host passthrough at the cluster level.

To do this, specify a resource name and USB device name for each device you want first to add and then assign to a VM. You can allocate more than one device, each of which is known as a selector in the HyperConverged custom resource (CR), to a single resource name. If you have multiple identical USB devices on the cluster, you can choose to allocate a VM to a specific device.

Prerequisites

  • You have access to an OpenShift Container Platform cluster as a user who has the cluster-admin role.
  • You have installed the OpenShift CLI (oc).

Procedure

  1. Identify the USB device vendor and product:

    $ lsusb

    Example output

    Bus 003 Device 007: ID 1b1c:0a60 example_manufacturer example_product_name
    • If you cannot use the lsusb command, inspect the USB device configurations in the host’s /sys/bus/usb/devices/ directory:

      for dev in *; do
          if [[ -f "$dev/idVendor" && -f "$dev/idProduct" ]]; then
              echo "Device: $dev"
              echo -n "  Manufacturer : "; cat "$dev/manufacturer"
              echo -n "  Product: "; cat "$dev/product"
              echo -n "  Vendor ID : "; cat "$dev/idVendor"
              echo -n "  Product ID: "; cat "$dev/idProduct"
              echo
          fi
      done

      Example output

      Device: 3-7
        Manufacturer : example_manufacturer
        Product: example_product_name
        Vendor ID : 1b1c
        Product ID: 0a60
  2. Open the HyperConverged CR in your default editor by running the following command:

    $ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv
  3. Add the required USB device to the permittedHostDevices stanza of the HyperConvered CR. The following example adds a device with vendor ID 045e and product ID 07a5:

    apiVersion: hco.kubevirt.io/v1beta1
    kind: HyperConverged
    metadata:
      name: kubevirt-hyperconverged
      namespace: openshift-cnv
    spec:
      permittedHostDevices:
        usbHostDevices:
        - resourceName: kubevirt.io/peripherals
          selectors:
          - vendor: "045e"
            product: "07a5"
          - vendor: "062a"
            product: "4102"
          - vendor: "072f"
            product: "b100"
    • spec.permittedHostDevices defines the host devices that have permission to be used in the cluster.
    • spec.permittedHostDevices.usbHostDevices defines a list of available USB devices.
    • spec.permittedHostDevices.usbHostDevices.resourceName defines the USB device that you want to add and assign to the VM. In this example, the resource is bound to three devices, each of which is identified by vendor and product and is known as a selector.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동