Deploy the WEKA client on KVM virtual machines
Deploy WEKA clients in KVM guest VMs with SR-IOV and VF-LAG for isolated, high-performance storage access.
Deploy the WEKA client inside each KVM guest VM to provide WEKA storage with in-VM encryption and strong tenant data isolation. In this model, each VM installs the WEKA client independently within its own namespace and mounts the WEKA filesystem directly.
Using SR-IOV and VF-LAG, this deployment achieves performance comparable to the server-based model while keeping the KVM server entirely out of the data path. Each VM can be configured with a dedicated VLAN, IP address, and unique WEKA credentials, including access keys. If Kubernetes is deployed on top of the VMs, tenants can deploy the WEKA CSI driver directly within the VM.
Considerations
NIC requirement: DPDK requires a WEKA-approved Mellanox or NVIDIA adapter in switchdev mode. Supported models are ConnectX-6 Dx/Lx, ConnectX-7, and BlueField-3. Broadcom NICs are not supported for this deployment model.
MPESW for dual-port data path: If using a dual-port data path, Multiport eSwitch (MPESW) is required. MPESW is supported on ConnectX-6 Dx, ConnectX-7, and BlueField-2/3 only.
ConnectX-6 non-Dx limitation: The ConnectX-6 non-Dx does not support VF passthrough with LACP LAG. Its eSwitch uses per-physical-port FDBs in legacy mode, and the switch LACP hash may route replies to a port whose FDB has no rule for the VF MAC, causing 100% packet loss. Use ConnectX-6 Dx, ConnectX-7, BlueField-2, or BlueField-3 instead.
Server core budget: Plan for at least one DPDK core per VM. To run eight VMs on a single KVM server, budget eight cores on that server for DPDK use.
One VF per VM: Each VM requires its own VF. A single VF cannot be shared across multiple guests.
Live migration: SR-IOV VFs are pinned to a NIC, so VM migration is offline or replicated. Live migration is not supported.
WEKA client visibility: Because the WEKA client is installed inside the VM, the tenant is responsible for understanding WEKA client behavior and operations.
Qualified OS: Ubuntu 24.04 has been tested and qualified for this deployment model.
nvidia_vf_single_ip=true: This is a mount-time flag. It cannot be added to an already-mounted filesystem. Unmount and remount with the flag if needed.Switch-side LACP: Switch-side LACP is required for full LAG. Without it, LACP state stays in monitoring mode and the bond operates as active-backup, limiting bandwidth to one 50G port.
WEKA version for multi-core:
num_coresgreater than 1 requires WEKA 5.1.20 or later. In version 5.1.19 and earlier,num_coresis effectively 1 regardless of the value passed.
Before you begin
Prepare the KVM server and WEKA cluster before configuring guest VM access.
KVM server: A Linux server with kernel 6.3 or later. This procedure covers Ubuntu 24.04.
WEKA cluster: A running WEKA cluster at version 5.1.20 or later.
WEKA client installer: The compatible WEKA client installer is available from a cluster backend.
For VF-LAG, also prepare the following:
NIC ports: Two ports on the same NIC. Aggregation across two separate NICs is not supported.
L2 switch: An LACP-capable switch.
IOMMU: Enabled in BIOS. Intel VT-d or AMD-Vi is required for
vfio-pcivirtual function passthrough.
Workflow
Configure VF-LAG, create the guest VM, then install and mount the WEKA client.
1. Complete firmware prerequisites for VF-LAG
Skip this section if you are not using VF-LAG.
Begin by identifying the two Physical Function (PF) PCI addresses on the KVM server:
Check the current firmware configuration:
Set the required values using the
mftpackage:
A reboot is required after mlxconfig set. Defer the reboot until the end of the KVM server configuration step so that only one reboot is needed.
2. Configure the KVM server
Install packages.
Enable IOMMU and configure hugepages.
Use the grub.d append pattern rather than editing GRUB_CMDLINE_LINUX_DEFAULT directly. Cloud images override this variable from /etc/default/grub.d/50-cloudimg-settings.cfg.
Set hugepages to 16384 per VM (32 GiB). For N VMs, set hugepages=(N * 16384).
Autoload
vfio-pci.
Snapshot network state.
Save the current network configuration before making changes, in case a rollback is needed:
Reboot now to apply the firmware and kernel command-line changes:
After rebooting, confirm the changes are active:
3. Set up VF-LAG
Skip this section if you are not using VF-LAG.
Find Physical Function device names.
Bring Physical Functions down.
Switch to switchdev mode.
switchdev mode must be enabled before SR-IOV so that VF representor netdevs are created:
Create the LACP bond on the Physical Functions.
The LACP bond must exist before the Physical Functions are enslaved. Configure the two switch ports as a LAG or port-channel with LACP on the switch before this step. Without switch-side LACP, the Physical Functions remain in monitoring state and load balancing does not engage. Active-backup still works, but bandwidth is limited to one port.
Enable SR-IOV.
Set VF MAC addresses.
Use devlink port function set to assign a unique MAC address to each VF. This installs an FDB rule in the MPESW table so that frames for the VF MAC are steered to the correct VF regardless of the driver the VF is bound to. The leading 02 bit marks these as locally administered unicast MACs, which do not collide with any NIC's burned-in address.
Record each generated MAC address. Use the matching address in the guest network configuration.
Bind each VF to
vfio-pci.
Use driver_override with drivers_probe, not new_id. The new_id method globally adds the device ID to vfio-pci probing. driver_override is per-device and is the correct method for mlx5 VFs.
4. Wire VF representors to bond0
Connect each VF representor to bond0 to establish a Layer 2 path between each VM and the physical network. In switchdev mode, every VF has a VF representor netdev on the server, for example eth0. The representor is the server-side software proxy for the VF.
Without wiring the representor to bond0, there is no Layer 2 path between the VM and the physical network. ARP requests from the VM arrive at the representor and are dropped, and IP connectivity cannot be established.
Weka DPDK operates at Layer 2 and opens raw Ethernet ports to communicate directly with cluster backends. IP routing on the server cannot provide a Layer 2 forwarding path. A bridge or TC redirect is the required mechanism.
When the bridge forwards the first frame from a representor, it installs an extern_learn offload FDB entry in the eSwitch. The hardware then forwards all subsequent unicast frames for that MAC directly between the VF and the bond uplink, bypassing the server CPU entirely. The bridge remains in the data path only for the first packet of each new flow (ARP and initial TCP SYN). Measured hardware offload ratios exceed 99%.
5. Create the guest VM.
Prepare the disk and cloud-init seed.
Find the VF PCI address for the guest VM.
Define the VM XML.
Update the following XML for each VM. Change the name, disk, seed image, VF address, and NUMA cpuset as needed.
Define and start the guest VM:
6. Configure the guest OS
SSH into the guest using the management NIC. To identify the guest IP address, run virsh net-dhcp-leases default on the server.
Name and address the VF.
Identify the VF network interface:
Create /etc/netplan/60-vf.yaml:
Apply and verify:
Set hugepages inside the guest.
After rebooting, verify: grep HugePages_Total /proc/meminfo.
Install
mlx5_ib.
Minimal cloud images do not include mlx5_ib. WEKA checks /sys/class/infiniband/ at mount time, so this module must be present:
7. Install and mount the WEKA client
Install the WEKA client.
Install the WEKA client from a cluster backend. No external internet connection is required. The backends serve the installer directly:
Mount the WEKA filesystem.
Use the nvidia_vf_single_ip=true mount option. This option tells WEKA that the NIC is a VF backed by a hardware LAG bond, that all DPDK processes on this VF share a single IP, and to use rte_flow_isolate(1) to pull flows away from the kernel netdev.
8. Configure multiple cores
Each core maps to a separate hardware TX/RX queue pair on the VF. Use the following table to choose num_cores based on the number of guest vCPUs:
4
2
Leaves 2 vCPUs for the OS and WEKA agent.
6
4
Sweet spot for throughput. Measured at parity with bare metal.
8
6
For high-throughput workloads. Monitor guest CPU utilization.
10+
8
Do not exceed the hardware queue count. Check with ethtool -l <vf-dev>.
Last updated