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:
          - masquerade: {} (1)
            name: default
          - name: <sriov-network> (2)
            sriov: {}
      networks:
      - name: default (3)
        pod: {}
      - multus:
        name: <sriov-network> (4)
    ...
    1 The masquerade binding to the default Pod network.
    2 The name of the SR-IOV network.
    3 The default Pod network.
    4 The name of the SR-IOV network. This is the same value as the interfaces.name.
  2. Apply the virtual machine configuration:

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