mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
66 lines
2.4 KiB
Plaintext
66 lines
2.4 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * virt/vm_networking/virt-connecting-vm-to-secondary-udn.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="virt-attaching-vm-to-secondary-udn_{context}"]
|
|
= Attaching a virtual machine to secondary user-defined networks by using the CLI
|
|
|
|
[role="_abstract"]
|
|
You can connect a virtual machine (VM) to multiple secondary cluster-scoped user-defined networks (CUDNs) by configuring the interface binding.
|
|
|
|
.Prerequisites
|
|
* You have installed the {oc-first}.
|
|
|
|
.Procedure
|
|
. Edit the `VirtualMachine` manifest to add the CUDN interface details, as in the following example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: kubevirt.io/v1
|
|
kind: VirtualMachine
|
|
metadata:
|
|
name: example-vm
|
|
namespace: red
|
|
spec:
|
|
template:
|
|
spec:
|
|
domain:
|
|
devices:
|
|
interfaces:
|
|
- name: secondary_localnet
|
|
bridge: {}
|
|
machine:
|
|
type: ""
|
|
resources:
|
|
requests:
|
|
memory: 2048M
|
|
networks:
|
|
- name: secondary_localnet
|
|
multus:
|
|
networkName: <localnet_cudn_name>
|
|
----
|
|
+
|
|
where:
|
|
|
|
`metadata.namespace`:: Specifies the namespace in which the VM is located. This value must match a namespace that is associated with the secondary CUDN.
|
|
`spec.template.spec.domain.devices.interfaces.name`:: Specifies the name of the secondary user-defined network interface.
|
|
`spec.template.spec.networks.name`:: Specifies the name of the network. This value must match the value of the `spec.template.spec.domain.devices.interfaces.name` field.
|
|
`spec.template.spec.networks.multus.networkName`:: Specifies the name of the localnet `ClusterUserDefinedNetwork` object that you previously created.
|
|
|
|
. Apply the `VirtualMachine` manifest by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f <filename>.yaml
|
|
----
|
|
+
|
|
where:
|
|
|
|
<filename>:: Specifies the name of your `VirtualMachine` manifest YAML file.
|
|
+
|
|
[NOTE]
|
|
====
|
|
When running {VirtProductName} on {ibm-z-name}, be aware that certain network interfaces, such as OSA, RoCE, and HiperSockets, only forward network traffic to devices that are registered with the respective interface. As a result, any traffic that is destined for unregistered devices is not forwarded. For more information, see link:https://www.ibm.com/docs/en/linux-on-systems?topic=choices-osa-interface-traffic-forwarding[OSA interface traffic forwarding] (IBM documentation).
|
|
====
|