Skip to content

Commit a89c44b

Browse files
authored
Merge pull request #111399 from ousleyp/cnv-81479
CNV#81479: USB device bugfix
2 parents ebf668c + 0297cc2 commit a89c44b

2 files changed

Lines changed: 20 additions & 36 deletions

File tree

modules/virt-configuring-vm-use-usb-device.adoc

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ You can configure virtual machine (VM) access to a USB device. This configuratio
2323
$ oc get {HCOCliKind} kubevirt-hyperconverged -n {CNVNamespace}
2424
----
2525
+
26-
*Example output*
26+
Example output:
2727
+
2828
[source, yaml]
2929
----
3030
# ...
31-
spec:
31+
spec:
3232
permittedHostDevices:
3333
usbHostDevices:
3434
- resourceName: kubevirt.io/peripherals
@@ -41,42 +41,43 @@ $ oc get {HCOCliKind} kubevirt-hyperconverged -n {CNVNamespace}
4141
product: "b100"
4242
----
4343

44-
. Open the VM instance CR:
44+
. Open the VM CR:
4545
+
4646
[source,terminal]
4747
----
48-
$ oc edit vmi <vmi_usb>
48+
$ oc edit vm <vm_name>
4949
----
5050
+
5151
where:
5252
+
53-
`<vmi_usb>`:: Specifies the name of the `VirtualMachineInstance` CR.
54-
53+
`<vm_name>`:: Specifies the name of the `VirtualMachine` CR.
5554

5655
. Edit the CR by adding the USB device, as shown in the following example:
5756
+
58-
*Example configuration*
57+
Example configuration:
5958
+
6059
[source, yaml]
6160
----
6261
apiVersion: kubevirt.io/v1
63-
kind: VirtualMachineInstance
62+
kind: VirtualMachine
6463
metadata:
65-
labels:
66-
special: vmi-usb
67-
name: vmi-usb
64+
name: example-vm
6865
spec:
69-
domain:
70-
devices:
71-
hostDevices:
72-
- deviceName: kubevirt.io/peripherals
73-
name: local-peripherals
66+
template:
67+
spec:
68+
architecture: amd64
69+
domain:
70+
devices:
71+
hostDevices:
72+
- deviceName: kubevirt.io/peripherals
73+
name: local-peripherals
7474
# ...
7575
----
7676
+
77-
* `spec.domain.devices.hostDevices.name` defines the name of the USB device.
77+
* `spec.template.spec.domain.devices.hostDevices.deviceName` specifies the resource name from the `HyperConverged` CR.
78+
* `spec.template.spec.domain.devices.hostDevices.name` defines the name of the USB device.
7879
79-
. Apply the modifications to the VM configurations:
80+
. Save and apply your changes:
8081
+
8182
[source,terminal]
8283
----
@@ -85,4 +86,4 @@ $ oc apply -f <filename>.yaml
8586
+
8687
where:
8788
+
88-
<filename>:: Specifies the name of the `VirtualMachineInstance` manifest YAML file.
89+
`<filename>`:: Specifies the name of the `VirtualMachine` manifest YAML file.

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,6 @@ To do this, specify a resource name and USB device name for each device you want
1818
1919
.Procedure
2020

21-
. Ensure that the `HostDevices` feature gate is enabled:
22-
+
23-
[source,terminal]
24-
----
25-
$ oc get featuregate cluster -o yaml
26-
----
27-
+
28-
*Successful output*
29-
+
30-
[source,yaml]
31-
----
32-
featureGates:
33-
# ...
34-
enabled:
35-
- name: HostDevices
36-
----
37-
3821
. Identify the USB device vendor and product:
3922
+
4023
[source,terminal]

0 commit comments

Comments
 (0)