# Creating HVM SR-IOV Network

## About this task

The HVM SR-IOV Network uses SR-IOV Virtual Functions (VFs) on a physical NIC to deliver near-native network performance. The plugin maps a libvirt `hostdev` network to a Physical Function (PF), and libvirt manages the assignment of VFs to individual VMs. The NIC hardware performs VLAN Switch Tagging (VST), inserting and removing VLAN tags directly in hardware, making the process transparent to the VM guest OS.

NOTE

- The system does not support live migration of VMs that use SR-IOV networks. Ensure that you enable SR-IOV in the host BIOS/UEFI before configuring SR-IOV networks, as this is the only required host-level configuration prior to setup.
- The plugin automatically detects SR-IOV-capable NICs, enables Virtual Functions (VFs) on the host, and creates the required libvirt network definitions, eliminating the need for manual VF configuration.

## Procedure

1. Navigate to Infrastructure > Network > Networks
2. Select + Add > HVM SR-IOV Network
3. Enter the following details in the Create Network:

   - Group: Select the group to which the data network belongs from the drop down menu.
   - Network Service: Select the network service to which the data network belongs from the drop down menu.
   - Name: Enter the name of the SR-IOV network.
   - Display Name: Enter a user-friendly name. The system displays this name in the UI.
   - Labels: Enter comma-separated labels. Use labels to organize and filter networks.
   - Description: Enter a description to document the purpose or usage of the network.
   - Enable IPv4: Enable this option to configure IPv4 for the network.
   - CIDR: Specify the IP subnet for the overlay network (for example, 10.10.10.0/24). The system does not allow modification of this value after creation.
   - Resource Pool: Select the HVM cluster where you want to create the network.
   - VLAN ID: Specify the VLAN ID that the NIC uses for hardware VLAN tagging (range: 0–4094). Use `0` to indicate untagged traffic.
   - SR-IOV NIC: Select the name of the SR-IOV-capable Physical Function (PF) interface on the hosts. For example, `ens1f0np0`. The dropdown may display multiple names for the same physical NIC, including the kernel name and alternative identifiers such as firmware-assigned labels. All entries for a given NIC refer to the same Physical Function (PF). Select the name your environment uses consistently. Prefer the kernel name when possible. Use alternative names only if kernel names differ across cluster hosts.
   - Active: Select this checkbox to activate the network immediately upon creation.
   - DHCP Server: Select this checkbox to enable the internal Dynamic Host Configuration Protocol (DHCP) server for automatic IP assignment.
   - Allow IP Override: Select this checkbox to let workloads override their assigned IP addresses.
   - Network Pool: Select an IP address pool from the drop-down menu to allocate blocks for this network.
   - Domain: Select the network search domain from the drop-down menu to resolve hostnames.
   - IPv6 Options: Expand this section to configure Internet Protocol version 6 (IPv6) network settings.

     - Enable IPv6: Select this checkbox to activate IPv6 routing and addressing on the network.
     - CIDR : Enter the IPv6 network address and routing prefix block in CIDR notation.
     - DHCP Server: Select this checkbox to enable automatic IPv6 addressing via the internal DHCPv6 server
     - Network Pool: Select an IPv6 address pool from the drop-down menu to allocate blocks for this network.
   - Advanced Options: Expand this section to configure advanced routing and network proxy parameters.

     - Search Domains: Enter a space-separated or comma-separated list of DNS search domains to resolve short hostnames.
     - Proxy: Select a designated proxy server profile from the drop-down menu to route external network traffic.
     - Bypass Proxy For Appliance URL: Select this checkbox to route internal management appliance traffic directly instead of using the proxy server.
     - No Proxy: Enter a comma-separated list of IP addresses, subnets, or domains to bypass proxy server routing.
   - Guest Console Options: Expand this section to configure remote access properties for guest workloads.

     - VDI Gateway: Select the Virtual Desktop Infrastructure (VDI) gateway from the drop-down menu to handle remote console traffic.
     - SSH Jump Host: Enter the endpoint address of the Secure Shell (SSH) bastion or jump host to secure external administrative access.
     - SSH Jump Port: Enter the port number for the SSH jump host.
     - SSH User: Enter the credential username for the SSH jump host.
     - SSH Password: Enter the credential password for the SSH jump host.
     - SSH Keypair: Select an SSH key pair from the drop-down menu.
   - Group Access: Expand this section to manage access for specific groups.

     - Access Select this checkbox to grant network access to the group.
     - Default Select this checkbox to make this network the group default.
4. Click Save Changes

## Results

The system creates a libvirt **hostdev network attachment pool** on each host and binds it to the specified Physical Function (PF). It registers a VLAN network segment for the specified VLAN ID within this pool. When a VM attaches to this network, the system assigns a dedicated VF-backed vNIC, and the NIC hardware handles VLAN tagging using VLAN Switch Tagging (VST), eliminating the need for an OVS bridge.

The libvirt network attachment pool uses the following XML structure (named `sriov-passthrough-{pfName}`):

```
```
<network>  
  <name>sriov-passthrough-ens1f0np0</name>  
  <forward mode='hostdev' managed='yes'>  
    <pf dev='ens1f0np0'/>  
  </forward>  
</network>
```
```

When a VM connects to this network, libvirt automatically selects and assigns an available VF from the PF. The VM guest OS detects the VF as a standard NIC (for example, `eth1`), and the user can configure it directly:

```
```
ip addr add 10.x.x.x/22 dev eth1
```
```
