Skip to content

Commit da11096

Browse files
nunnatsaopenshift-cherrypick-robot
authored andcommitted
Fix the "Enabling USB host passthrough" wrong procedure
The current "Enabling USB host passthrough procedure" is wrong in three ways: * First, it uses the HyperConverged jsonpatch anntoation, which is not formally supported, and is should only be use as last resort, while the HyperConverged type contain the fields to implement the procedure in a supported way. * Using the jsonpatch annotation, triggers an alert! * In addition, the verification phase is also wrong, as it checks the HyperConverged CR instead of the KubeVirt CR. Signed-off-by: Nahshon Unna Tsameret <nunnatsa@redhat.com>
1 parent 1c4d516 commit da11096

1 file changed

Lines changed: 21 additions & 37 deletions

File tree

modules/virt-enabling-usb-host-passthrough.adoc

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -76,54 +76,38 @@ Device: 3-7
7676
----
7777
7878
79-
. 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`:
79+
. Open the `HyperConverged` CR in your default editor by running the following command:
8080
+
81-
[source,terminal]
81+
[source,terminal,subs="attributes+"]
8282
----
83-
oc patch hyperconverged kubevirt-hyperconverged \
84-
-n openshift-cnv \
85-
--type=merge \
86-
-p '{
87-
"metadata": {
88-
"annotations": {
89-
"kubevirt.kubevirt.io/jsonpatch": "[{\"op\": \"add\", \"path\": \"/spec/permittedHostDevices/usbHostDevices/-\", \"value\": {\"resourceName\": \"kubevirt.io/peripherals\", \"selectors\": [{\"vendor\": \"045e\", \"product\": \"07a5\"}]}}]"
90-
}
91-
}
92-
}'
83+
$ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace}
9384
----
9485
95-
.Verification
9686
97-
* Ensure that the HCO CR contains the required USB devices:
98-
+
99-
[source,terminal]
100-
----
101-
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv
102-
----
103-
+
104-
*Example output*
87+
. 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`:
10588
+
106-
[source,yaml,subs="attributes+"]
89+
[source,yaml,highlight=11..12,subs="attributes+"]
10790
----
10891
apiVersion: hco.kubevirt.io/v1beta1
10992
kind: HyperConverged
11093
metadata:
111-
name: kubevirt-hyperconverged
112-
namespace: {CNVNamespace}
94+
name: kubevirt-hyperconverged
95+
namespace: {CNVNamespace}
11396
spec:
114-
permittedHostDevices:
115-
usbHostDevices:
116-
- resourceName: kubevirt.io/peripherals
117-
selectors:
118-
- vendor: "045e"
119-
product: "07a5"
120-
- vendor: "062a"
121-
product: "4102"
122-
- vendor: "072f"
123-
product: "b100"
124-
97+
permittedHostDevices:
98+
usbHostDevices:
99+
- resourceName: kubevirt.io/peripherals
100+
selectors:
101+
- vendor: "045e"
102+
product: "07a5"
103+
- vendor: "062a"
104+
product: "4102"
105+
- vendor: "072f"
106+
product: "b100"
125107
----
126108
+
127109
* `spec.permittedHostDevices` defines the host devices that have permission to be used in the cluster.
128-
* `spec.permittedHostDevices.usbHostDevices` defines the available USB devices.
129-
* Use `resourceName: deviceName` for each device 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`.
110+
* `spec.permittedHostDevices.usbHostDevices` defines a list of available USB devices.
111+
* `spec.permittedHostDevices.usbHostDevices.resourceName` defines the USB device that you want to add and assign to the
112+
VM. In this example, the resource is bound to three devices, each of which is identified by `vendor` and `product` and
113+
is known as a `selector`.

0 commit comments

Comments
 (0)