×

You can attach a virtual machine to use a Single Root I/O Virtualization (SR-IOV) network as a secondary network.

Attaching a virtual machine to an SR-IOV network

You can attach the virtual machine to the SR-IOV network by including the network details in the virtual machine configuration.

Procedure
  1. Include the SR-IOV network details in the spec.domain.devices.interfaces and spec.networks of the virtual machine configuration:

    kind: VirtualMachine
    ...
    spec:
      domain:
        devices:
          interfaces:
          - name: <default> (1)
            masquerade: {} (2)
          - name: <nic1> (3)
            sriov: {}
      networks:
      - name: <default> (4)
        pod: {}
      - name: <nic1> (5)
        multus:
            networkName: <sriov-network> (6)
    ...
    1 A unique name for the interface that is connected to the Pod network.
    2 The masquerade binding to the default Pod network.
    3 A unique name for the SR-IOV interface.
    4 The name of the Pod network interface. This must be the same as the interfaces.name that you defined earlier.
    5 The name of the SR-IOV interface. This must be the same as the interfaces.name that you defined earlier.
    6 The name of the SR-IOV network attachment definition.
  2. Apply the virtual machine configuration:

    $ oc apply -f <vm-sriov.yaml> (1)
    1 The name of the virtual machine YAML file.