10.4.3. Attaching a virtual machine to secondary user-defined networks by using the CLI


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 OpenShift CLI (oc).

Procedure

  1. Edit the VirtualMachine manifest to add the CUDN interface details, as in the following example:

    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>
    • 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.
  2. Apply the VirtualMachine manifest by running the following command:

    $ oc apply -f <filename>.yaml

    where:

    <filename>

    Specifies the name of your VirtualMachine manifest YAML file.

    注記

    When running OpenShift Virtualization on IBM Z®, 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.

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

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

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

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

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

Legal Notice

Theme

© 2026 Red Hat
トップに戻る