10.10.3. Attaching a virtual machine to an OVN-Kubernetes secondary network using the CLI


You can connect a virtual machine (VM) to the OVN-Kubernetes secondary network by including the network details in the VM configuration.

Prerequisites

  • You have access to the cluster as a user with cluster-admin privileges.
  • You have installed the OpenShift CLI (oc).

Procedure

  1. Edit the VirtualMachine manifest to add the OVN-Kubernetes secondary network interface details, as in the following example:

    apiVersion: kubevirt.io/v1
    kind: VirtualMachine
    metadata:
      name: vm-server
    spec:
      runStrategy: Always
      template:
        spec:
          domain:
            devices:
              interfaces:
              - name: secondary
                bridge: {}
            resources:
              requests:
                memory: 1024Mi
          networks:
          - name: secondary
            multus:
              networkName: <nad_name>
          nodeSelector:
            node-role.kubernetes.io/worker: ''
    # ...
    • spec.template.spec.domain.devices.interfaces.name specifies the name of the OVN-Kubernetes secondary interface.
    • 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.
    • spec.template.spec.networks.multus.networkName specifies the name of the NetworkAttachmentDefinition object.
    • spec.template.spec.nodeSelector specifies the nodes on which the VM can be scheduled. The recommended node selector value is node-role.kubernetes.io/worker: ''.
  2. Apply the VirtualMachine manifest:

    $ oc apply -f <filename>.yaml
  3. Optional: If you edited a running virtual machine, you must restart it for the changes to take effect.
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る