1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc
2026-01-20 15:11:10 +00:00

61 lines
4.3 KiB
Plaintext

:_mod-docs-content-type: ASSEMBLY
[id="virt-connecting-vm-to-ovn-secondary-network"]
= Connecting a virtual machine to an OVN-Kubernetes layer 2 secondary network
include::_attributes/common-attributes.adoc[]
:context: virt-connecting-vm-to-ovn-secondary-network
toc::[]
ifdef::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
You can connect a VM to an Open Virtual Network (OVN)-Kubernetes secondary network. {VirtProductName} supports the `layer2` topology for OVN-Kubernetes.
A `layer2` topology connects workloads by a cluster-wide logical switch. The OVN-Kubernetes Container Network Interface (CNI) plugin uses the Geneve (Generic Network Virtualization Encapsulation) protocol to create an overlay network between nodes. You can use this overlay network to connect VMs on different nodes, without having to configure any additional physical networking infrastructure.
endif::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
ifndef::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
You can connect a virtual machine (VM) to an OVN-Kubernetes `layer2` secondary network by using the CLI.
A `layer2` topology connects workloads by a cluster-wide logical switch. The OVN-Kubernetes Container Network Interface (CNI) plugin uses the Geneve (Generic Network Virtualization Encapsulation) protocol to create an overlay network between nodes. You can use this overlay network to connect VMs on different nodes, without having to configure any additional physical networking infrastructure.
[NOTE]
====
An OVN-Kubernetes secondary network is compatible with the xref:../../networking/multiple_networks/secondary_networks/configuring-multi-network-policy.adoc#compatibility-with-multi-network-policy_configuring-additional-network[multi-network policy API] which provides the `MultiNetworkPolicy` custom resource definition (CRD) to control traffic flow to and from VMs. You must use the `ipBlock` attribute to define network policy ingress and egress rules for specific CIDR blocks. You cannot use pod or namespace selectors for virtualization workloads.
====
endif::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
To configure an OVN-Kubernetes `layer2` secondary network and attach a VM to that network, perform the following steps:
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#virt-connecting-vm-to-ovn-secondary-network[Configure an OVN-Kubernetes layer 2 secondary network].
. xref:../../virt/vm_networking/virt-connecting-vm-to-ovn-secondary-network.adoc#attaching-vm-to-ovn-secondary-nw[Connect the VM to the OVN-Kubernetes layer 2 secondary network].
[id="creating-ovn-nad_{context}"]
== Creating an OVN-Kubernetes layer 2 NAD
You can create an OVN-Kubernetes network attachment definition (NAD) for the layer 2 network topology by using the {product-title} web console or the CLI.
[NOTE]
====
Configuring IP address management (IPAM) by specifying the `spec.config.ipam.subnet` attribute in a network attachment definition for virtual machines is not supported.
====
include::modules/virt-creating-layer2-nad-cli.adoc[leveloffset=+2]
include::modules/virt-creating-nad-l2-overlay-console.adoc[leveloffset=+2]
[id="attaching-vm-to-ovn-secondary-nw"]
== Attaching a virtual machine to the OVN-Kubernetes layer 2 secondary network
You can attach a virtual machine (VM) to the OVN-Kubernetes layer 2 secondary network interface by using the {product-title} web console or the CLI.
include::modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc[leveloffset=+2]
ifndef::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]
[role="_additional-resources"]
[id="additional-resources_virt-connecting-vm-to-ovn-secondary-network"]
== Additional resources
* xref:../../networking/multiple_networks/secondary_networks/creating-secondary-nwt-ovnk.adoc#configuration-ovnk-additional-networks_configuring-additional-network[Creating secondary networks on OVN-Kubernetes]
* xref:../../networking/networking_operators/k8s-nmstate-about-the-k8s-nmstate-operator.adoc#k8s-nmstate-about-the-k8s-nmstate-operator[About the Kubernetes NMState Operator]
* xref:../../networking/multiple_networks/primary_networks/about-primary-nwt-nad.adoc#understanding-multiple-networks[Creating primary networks using a NetworkAttachmentDefinition]
endif::openshift-rosa,openshift-dedicated,openshift-rosa-hcp[]