You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/virt-adding-kernel-arguments-enable-iommu.adoc
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,9 @@ spec:
38
38
- intel_iommu=on
39
39
# ...
40
40
----
41
-
where:
42
-
43
-
<apiversion>:: Applies the new kernel argument only to worker nodes.
44
-
45
-
<name>:: Indicates the ranking of this kernel argument (100) among the machine configs and its purpose. If you have an AMD CPU, specify the kernel argument as `amd_iommu=on`.
46
-
47
-
<intel_iommu=o>:: Identifies the kernel argument as `intel_iommu` for an Intel CPU.
41
+
**`metadata.labels.machineconfiguration.openshift.io/role` specifies that the new kernel argument is applied only to worker nodes.
42
+
**`metadata.name` specifies the ranking of this kernel argument (100) among the machine configs and its purpose. If you have an AMD CPU, specify the kernel argument as `amd_iommu=on`.
43
+
**`spec.kernelArguments` specifies the kernel argument as `intel_iommu` for an Intel CPU.
Copy file name to clipboardExpand all lines: modules/virt-assigning-pci-device-virtual-machine.adoc
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,7 @@ spec:
26
26
- deviceName: nvidia.com/TU104GL_Tesla_T4
27
27
name: hostdevices1
28
28
----
29
-
+
30
-
where:
31
-
+
32
-
`deviceName`:: Specifies the name of the PCI device that is permitted on the cluster as a host device. The virtual machine can access this host device.
29
+
**`spec.template.spec.domain.devices.hostDevices.deviceName` specifies the name of the PCI device that is permitted on the cluster as a host device. The virtual machine can access this host device.
= Attaching a virtual machine to the primary user-defined network by using the CLI
8
8
9
9
[role="_abstract"]
10
10
You can connect a virtual machine (VM) to the primary user-defined network (UDN) by using the CLI.
11
11
12
12
.Prerequisites
13
-
* You have installed the OpenShift CLI (`oc`).
13
+
14
+
* You have installed the {oc-first}.
14
15
15
16
.Procedure
17
+
16
18
. Edit the `VirtualMachine` manifest to add the UDN interface details, as in the following example:
17
19
+
18
20
Example `VirtualMachine` manifest:
@@ -23,26 +25,26 @@ apiVersion: kubevirt.io/v1
23
25
kind: VirtualMachine
24
26
metadata:
25
27
name: example-vm
26
-
namespace: my-namespace # <1>
28
+
namespace: my-namespace
27
29
spec:
28
30
template:
29
31
spec:
30
32
domain:
31
33
devices:
32
34
interfaces:
33
-
- name: udn-l2-net # <2>
34
-
binding:
35
-
name: l2bridge # <3>
35
+
- name: udn-l2-net
36
+
binding:
37
+
name: l2bridge
36
38
# ...
37
39
networks:
38
-
- name: udn-l2-net # <4>
40
+
- name: udn-l2-net
39
41
pod: {}
40
42
# ...
41
43
----
42
-
<1> The namespace in which the VM is located. This value must match the namespace in which the UDN is defined.
43
-
<2> The name of the user-defined network interface.
44
-
<3> The name of the binding plugin that is used to connect the interface to the VM. The possible values are `l2bridge` and `passt`. The default value is `l2bridge`.
45
-
<4> The name of the network. This must match the value of the `spec.template.spec.domain.devices.interfaces.name` field.
44
+
**`metadata.namespace` specifies the namespace in which the VM is located. This value must match the namespace in which the UDN is defined.
45
+
**`spec.template.spec.domain.devices.interfaces.name` specifies the name of the user-defined network interface.
46
+
**`spec.template.spec.domain.devices.interfaces.binding.name` specifies the name of the binding plugin that is used to connect the interface to the VM. The possible values are `l2bridge` and `passt`. The default value is `l2bridge`.
47
+
**`spec.template.spec.networks.name` specifies the name of the network. This must match the value of the `spec.template.spec.domain.devices.interfaces.name` field.
46
48
47
49
. Optional: If you are using the Plug a Simple Socket Transport (passt) network binding plugin, set the `hco.kubevirt.io/deployPasstNetworkBinding` annotation to `true` in the `HyperConverged` custom resource (CR) by running the following command:
Copy file name to clipboardExpand all lines: modules/virt-attaching-vm-to-sriov-network.adoc
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,22 +27,25 @@ spec:
27
27
domain:
28
28
devices:
29
29
interfaces:
30
-
- name: nic1 <1>
30
+
- name: nic1
31
31
sriov: {}
32
32
networks:
33
-
- name: nic1 <2>
33
+
- name: nic1
34
34
multus:
35
-
networkName: sriov-network <3>
35
+
networkName: sriov-network
36
36
# ...
37
37
----
38
-
<1> Specify a unique name for the SR-IOV interface.
39
-
<2> Specify the name of the SR-IOV interface. This must be the same as the `interfaces.name` that you defined earlier.
40
-
<3> Specify the name of the SR-IOV network attachment definition.
38
+
**`spec.template.spec.domain.devices.interfaces.name` specifies a unique name for the SR-IOV interface.
39
+
**`spec.template.spec.networks.name` specifies the name of the SR-IOV interface. This must be the same as the `interfaces.name` that you defined earlier.
40
+
**`spec.template.spec.networks.multus.networkName` specifies the name of the SR-IOV network attachment definition.
41
41
42
42
. Apply the virtual machine configuration:
43
43
+
44
44
[source,terminal]
45
45
----
46
-
$ oc apply -f <vm_sriov>.yaml <1>
46
+
$ oc apply -f <vm_sriov>.yaml
47
47
----
48
-
<1> The name of the virtual machine YAML file.
48
+
+
49
+
where:
50
+
+
51
+
`<vm_sriov>`:: Specifies the name of the virtual machine YAML file.
<1> This annotation is required for storage classes with `volumeBindingMode` set to `WaitForFirstConsumer`.
56
-
<2> Schedule for the job specified in cron format.
57
-
<3> Use to create a data volume from a registry source. Use the default `pod` `pullMethod` and not `node` `pullMethod`, which is based on the `node` docker cache. The `node` docker cache is useful when a registry image is available via `Container.Image`, but the CDI importer is not authorized to access it.
58
-
<4> For the custom image to be detected as an available boot source, the name of the image's `managedDataSource` must match the name of the template's `DataSource`, which is found under `spec.dataVolumeTemplates.spec.sourceRef.name` in the VM template YAML file.
55
+
**`spec.dataImportCronTemplates.metadata.annotations` specifies a required annotation for storage classes with `volumeBindingMode` set to `WaitForFirstConsumer`.
56
+
**`spec.dataImportCronTemplates.spec.schedule` specifies the schedule for the job, specified in cron format.
57
+
**`spec.dataImportCronTemplates.spec.template.spec.source.registry` specifies the registry source to use to create a data volume. Use the default `pod``pullMethod` and not `node``pullMethod`, which is based on the `node` docker cache. The `node` docker cache is useful when a registry image is available via `Container.Image`, but the CDI importer is not authorized to access it.
58
+
**`spec.dataImportCronTemplates.spec.managedDataSource` specifies the name of the managed data source. For the custom image to be detected as an available boot source, the name of the image's `managedDataSource` must match the name of the template's `DataSource`, which is found under `spec.dataVolumeTemplates.spec.sourceRef.name` in the VM template YAML file.
Copy file name to clipboardExpand all lines: modules/virt-binding-devices-vfio-driver.adoc
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,12 @@ To bind PCI devices to the VFIO (Virtual Function I/O) driver, obtain the values
12
12
The `MachineConfig` Operator generates the `/etc/modprobe.d/vfio.conf` on the nodes with the PCI devices, and binds the PCI devices to the VFIO driver.
13
13
14
14
.Prerequisites
15
+
15
16
* You added kernel arguments to enable IOMMU for the CPU.
16
17
* You have installed the {oc-first}.
17
18
18
19
.Procedure
20
+
19
21
. Run the `lspci` command to obtain the `vendor-ID` and the `device-ID` for the PCI device.
<1> Applies the new kernel argument only to worker nodes.
65
-
<2> Specify the previously determined `vendor-ID` value (`10de`) and the `device-ID` value (`1eb8`) to bind a single device to the VFIO driver. You can add a list of multiple devices with their vendor and device information.
66
-
<3> The file that loads the vfio-pci kernel module on the worker nodes.
66
+
**`metadata.labels.machineconfiguration.openshift.io/role: worker` specifies that the new kernel argument is applied only to worker nodes.
67
+
**`storage.files.contents.inline`, where the path is `/etc/modprobe.d/vfio.conf`, specifies the previously determined `vendor-ID` value (`10de`) and the `device-ID` value (`1eb8`) to bind a single device to the VFIO driver. You can add a list of multiple devices with their vendor and device information.
68
+
**`storage.files.path`, where the `contents.inline` is `vfio-pci`, specifies the file that loads the `vfio-pci` kernel module on the worker nodes.
67
69
68
70
. Use Butane to generate a `MachineConfig` object file, `100-worker-vfiopci.yaml`, containing the configuration to be delivered to the worker nodes:
69
71
+
@@ -102,6 +104,7 @@ NAME GENERATEDBYCONTROLLER IGNI
Copy file name to clipboardExpand all lines: modules/virt-configuring-storage-class-bootsource-update.adoc
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,21 +44,19 @@ spec:
44
44
template:
45
45
spec:
46
46
storage:
47
-
storageClassName: <storage_class> <1>
48
-
schedule: "0 */12 * * *" <2>
49
-
managedDataSource: <data_source> <3>
47
+
storageClassName: <storage_class>
48
+
schedule: "0 */12 * * *"
49
+
managedDataSource: <data_source>
50
50
# ...
51
51
----
52
-
<1> Define the storage class.
53
-
<2> Required: Schedule for the job specified in cron format.
54
-
<3> Required: The data source to use.
52
+
**`spec.dataImportCronTemplates.spec.template.spec.storage.storageClassName` specifies the storage class.
53
+
**`spec.dataImportCronTemplates.spec.schedule` is a required field that specifies the schedule for the job in cron format.
54
+
**`spec.dataImportCronTemplates.spec.managedDataSource` is a required field that specifies the data source to use.
55
55
+
56
-
--
57
56
[NOTE]
58
-
----
57
+
====
59
58
For the custom image to be detected as an available boot source, the value of the `spec.dataVolumeTemplates.spec.sourceRef.name` parameter in the VM template must match this value.
60
-
----
61
-
--
59
+
====
62
60
63
61
. Wait for the HyperConverged Operator (HCO) and Scheduling, Scale, and Performance (SSP) resources to complete reconciliation.
Copy file name to clipboardExpand all lines: modules/virt-creating-a-primary-cluster-udn.adoc
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,12 @@
10
10
You can connect multiple namespaces to the same primary user-defined network (UDN) to achieve native tenant isolation by using the CLI.
11
11
12
12
.Prerequisites
13
+
13
14
* You have access to the cluster as a user with `cluster-admin` privileges.
14
15
* You have installed the {oc-first}.
15
16
16
17
.Procedure
18
+
17
19
. Create a `ClusterUserDefinedNetwork` object to specify the custom network configuration.
18
20
+
19
21
Example `ClusterUserDefinedNetwork` manifest:
@@ -23,28 +25,28 @@ Example `ClusterUserDefinedNetwork` manifest:
23
25
apiVersion: k8s.ovn.org/v1
24
26
kind: ClusterUserDefinedNetwork
25
27
metadata:
26
-
name: cudn-l2-net # <1>
28
+
name: cudn-l2-net
27
29
spec:
28
-
namespaceSelector: # <2>
29
-
matchExpressions: # <3>
30
+
namespaceSelector:
31
+
matchExpressions:
30
32
- key: kubernetes.io/metadata.name
31
-
operator: In # <4>
33
+
operator: In
32
34
values: ["red-namespace", "blue-namespace"]
33
35
network:
34
-
topology: Layer2 # <5>
36
+
topology: Layer2
35
37
layer2:
36
-
role: Primary # <6>
38
+
role: Primary
37
39
ipam:
38
40
lifecycle: Persistent
39
41
subnets:
40
42
- 203.203.0.0/16
41
43
----
42
-
<1> Specifies the name of the `ClusterUserDefinedNetwork` custom resource.
43
-
<2> Specifies the set of namespaces that the cluster UDN applies to. The namespace selector must not point to `default`, an `openshift-*` namespace, or any global namespaces that are defined by the Cluster Network Operator (CNO).
44
-
<3> Specifies the type of selector. In this example, the `matchExpressions` selector selects objects that have the label `kubernetes.io/metadata.name` with the value `red-namespace` or `blue-namespace`.
45
-
<4> Specifies the type of operator. Possible values are `In`, `NotIn`, and `Exists`.
46
-
<5> Specifies the topological configuration of the network. The required value is `Layer2`. A `Layer2` topology creates a logical switch that is shared by all nodes.
47
-
<6> Specifies whether the UDN is primary or secondary. The `Primary` role means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
44
+
**`metadata.name` specifies the name of the `ClusterUserDefinedNetwork` custom resource.
45
+
**`spec.namespaceSelector` specifies the set of namespaces that the cluster UDN applies to. The namespace selector must not point to `default`, an `openshift-*` namespace, or any global namespaces that are defined by the Cluster Network Operator (CNO).
46
+
**`spec.namespaceSelector.matchExpressions` specifies the type of selector. In this example, the `matchExpressions` selector selects objects that have the label `kubernetes.io/metadata.name` with the value `red-namespace` or `blue-namespace`.
47
+
**`spec.namespaceSelector.matchExpressions.operator` specifies the type of operator. Possible values are `In`, `NotIn`, and `Exists`.
48
+
**`spec.network.topology` specifies the topological configuration of the network. The required value is `Layer2`. A `Layer2` topology creates a logical switch that is shared by all nodes.
49
+
**`spec.network.layer2.role` specifies whether the UDN is primary or secondary. The `Primary` role means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
48
50
49
51
. Apply the `ClusterUserDefinedNetwork` manifest by running the following command:
= Creating a primary namespace-scoped user-defined network by using the CLI
8
8
9
9
[role="_abstract"]
10
10
You can create an isolated primary network in your project namespace by using the CLI. You must use the OVN-Kubernetes layer 2 topology and enable persistent IP address allocation in the user-defined network (UDN) configuration to ensure VM live migration support.
11
11
12
12
.Prerequisites
13
+
13
14
* You have installed the {oc-first}.
14
15
* You have created a namespace and applied the `k8s.ovn.org/primary-user-defined-network` label.
15
16
16
17
.Procedure
18
+
17
19
. Create a `UserDefinedNetwork` object to specify the custom network configuration.
18
20
+
19
21
Example `UserDefinedNetwork` manifest:
@@ -23,23 +25,23 @@ Example `UserDefinedNetwork` manifest:
23
25
apiVersion: k8s.ovn.org/v1
24
26
kind: UserDefinedNetwork
25
27
metadata:
26
-
name: udn-l2-net # <1>
27
-
namespace: my-namespace # <2>
28
+
name: udn-l2-net
29
+
namespace: my-namespace
28
30
spec:
29
-
topology: Layer2 # <3>
30
-
layer2:
31
-
role: Primary # <4>
31
+
topology: Layer2
32
+
layer2:
33
+
role: Primary
32
34
subnets:
33
35
- "10.0.0.0/24"
34
-
- "2001:db8::/60"
36
+
- "2001:db8::/60"
35
37
ipam:
36
-
lifecycle: Persistent # <5>
38
+
lifecycle: Persistent
37
39
----
38
-
<1> Specifies the name of the `UserDefinedNetwork` custom resource.
39
-
<2> Specifies the namespace in which the VM is located. The namespace must have the `k8s.ovn.org/primary-user-defined-network` label. The namespace must not be `default`, an `openshift-*` namespace, or match any global namespaces that are defined by the Cluster Network Operator (CNO).
40
-
<3> Specifies the topological configuration of the network. The required value is `Layer2`. A `Layer2` topology creates a logical switch that is shared by all nodes.
41
-
<4> Specifies whether the UDN is primary or secondary. The `Primary` role means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
42
-
<5> Specifies that virtual workloads have consistent IP addresses across reboots and migration. The `spec.layer2.subnets` field is required when `ipam.lifecycle: Persistent` is specified.
40
+
**`metadata.name` specifies the name of the `UserDefinedNetwork` custom resource.
41
+
**`metadata.namespace` specifies the namespace in which the VM is located. The namespace must have the `k8s.ovn.org/primary-user-defined-network` label. The namespace must not be `default`, an `openshift-*` namespace, or match any global namespaces that are defined by the Cluster Network Operator (CNO).
42
+
**`spec.topology` specifies the topological configuration of the network. The required value is `Layer2`. A `Layer2` topology creates a logical switch that is shared by all nodes.
43
+
**`spec.layer2.role` specifies whether the UDN is primary or secondary. The `Primary` role means that the UDN acts as the primary network for the VM and all default traffic passes through this network.
44
+
**`spec.layer2.ipam.lifecycle` specifies that virtual workloads have consistent IP addresses across reboots and migration. The `spec.layer2.subnets` field is required when `ipam.lifecycle: Persistent` is specified.
43
45
44
46
. Apply the `UserDefinedNetwork` manifest by running the following command:
<1> This label is required for the namespace to be associated with a UDN. If the namespace is to be used with an existing cluster UDN, you must also add the appropriate labels that are defined in the `spec.namespaceSelector` field of the `ClusterUserDefinedNetwork` custom resource.
31
+
+
32
+
The `k8s.ovn.org/primary-user-defined-network` label is required for the namespace to be associated with a UDN. If the namespace is to be used with an existing cluster UDN, you must also add the appropriate labels that are defined in the `spec.namespaceSelector` field of the `ClusterUserDefinedNetwork` custom resource.
32
33
33
34
. Apply the `Namespace` manifest by running the following command:
0 commit comments