High availability for pod-level bonds on SR-IOV networks
For workloads by using pod-level bonding with SR-IOV virtual functions (VFs), despite an upstream switch failure, an underlying physical function (PF) might still report an up state. This creates a silent failure, as attached VFs remain up and pods continue to send traffic to a dead endpoint, causing packet loss.
The PF Status Relay Operator solves this issue by using Link Aggregation Control Protocol (LACP) as an active health check. In this configuration, each physical function (PF) is in its own single-member LACP bond with the upstream switch. When the Operator detects an LACP failure on a PF bond, it changes the link state of the attached VFs from auto to disabled. This action triggers the pod’s active-backup bond to fail over to its backup network path, maintaining high availability.
Configuring LACP state monitoring for SR-IOV networks is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Install the PF Status Relay Operator using the CLI
Install the PF Status Relay Operator to enable OpenShift Container Platform to use Link Aggregation Control Protocol (LACP) as an active health check on physical functions.
Prerequisites
- You configured LACP on your upstream switch.
- You configured pod-level bonding for your SR-IOV networks.
- You installed the OpenShift CLI (
oc). - You have cluster-admin privileges.
Procedure
- Create the
openshift-pf-status-relay-operatornamespace by entering the following command:$ cat << EOF| oc create -f -apiVersion: v1kind: Namespacemetadata:name: openshift-pf-status-relay-operatorannotations:workload.openshift.io/allowed: managementEOF - Create an
OperatorGroupcustom resource (CR) by entering the following command:$ cat << EOF| oc create -f -apiVersion: operators.coreos.com/v1kind: OperatorGroupmetadata:name: pf-status-relay-operatorsnamespace: openshift-pf-status-relay-operatorspec:targetNamespaces:- openshift-pf-status-relay-operatorEOF - Create a
SubscriptionCR for the PF Status Relay Operator by entering the following command:$ cat << EOF| oc create -f -apiVersion: operators.coreos.com/v1alpha1kind: Subscriptionmetadata:name: pf-status-relay-operator-subscriptionnamespace: openshift-pf-status-relay-operatorspec:channel: stablename: pf-status-relay-operatorsource: redhat-operatorssourceNamespace: openshift-marketplaceEOF
Verification
- To verify that the Operator is installed, enter the following command and then check that output shows
Succeededfor the Operator:$ oc get csv -n openshift-pf-status-relay-operator -o custom-columns=Name:.metadata.name,Phase:.status.phase
Installing the PF Status Relay Operator using the web console
Install the PF Status Relay Operator to enable OpenShift Container Platform to use Link Aggregation Control Protocol (LACP) as an active health check on physical functions.
Prerequisites
- You configured LACP on your upstream switch.
- You configured pod-level bonding for your SR-IOV networks.
- You have cluster-admin privileges.
Procedure
- Install the PF Status Relay Operator:
- In the OpenShift Container Platform web console, click Ecosystem → Software Catalog.
- Select PF Status Relay Operator from the list of available Operators, and then click Install.
- On the Install Operator page, under Installed Namespace, select Operator recommended Namespace.
- Click Install.
Verification
- Verify that the PF Status Relay Operator shows the Status as Succeeded on the Installed Operators dashboard.
Configure the PF Status Relay Operator for LACP state monitoring on SR-IOV networks
Use the PF Status Relay Operator to enable Link Aggregation Control Protocol (LACP) state monitoring for workloads by using pod-level bonding with SR-IOV networks.
The Operator monitors the LACP state on physical functions (PF) and changes the link state for attached virtual functions (VF) when it detects an upstream failure. With this approach, you can detect failures on VFs attached to a PF to ensure a timely failover to a backup network path, ensuring high availability for your workloads.
The following scenario demonstrates how to configure and verify LACP state monitoring for SR-IOV networks:
- Create host-level NIC bonds on worker nodes and configure LACP.
- Define SR-IOV network policies to create virtual functions (VFs) on the bonded interfaces.
- Deploy the PF Status Relay Operator to monitor physical functions and the LACP state.
- Verify that pods using these VFs automatically fail over to a backup network path in case of upstream switch failure.
The following scenario demonstrates how to configure and verify LACP state monitoring for SR-IOV networks. This scenario uses SR-IOV network cards with two ports on each node, worker-0 and worker-1, with both ports connected to a shared switch to support LACP bonding.
Prerequisites
- Nodes must have a NIC that supports SR-IOV.
- The SR-IOV Network Operator is installed.
- The PF Status Relay Operator is installed.
- The physical switch ports connected to the worker nodes are configured for LACP with a fast polling rate.
- The
linkStateis set toautoordisablefor the SR-IOV VFs that you want to monitor. The Operator ignores VFs with thelinkStateset toenable. The default value for SR-IOV VFs islinkState: auto.
Procedure
-
Create the project namespace by creating a
namespace.yamlfile such as the following example:Example namespace.yaml fileapiVersion: v1kind: Namespacemetadata:labels:kubernetes.io/metadata.name: sriov-operator-testspod-security.kubernetes.io/audit: privilegedpod-security.kubernetes.io/enforce: privilegedpod-security.kubernetes.io/warn: privilegedsecurity.openshift.io/scc.podSecurityLabelSync: "false"name: <namespace><namespace>specifies the namespace where you deploy the high-availability pod.
-
Apply the namespace by running the following command:
$ oc apply -f namespace.yaml -
Configure host-level LACP bonds:
-
Create a YAML file that defines the
NodeNetworkConfigurationPolicyresource for theens5f0interface on theworker-0node:Example nncpBondF0Worker0.yaml fileapiVersion: nmstate.io/v1kind: NodeNetworkConfigurationPolicymetadata:name: example-bond-f0spec:nodeSelector:kubernetes.io/hostname: <node_name>desiredState:interfaces:- name: example-bond-f0description: example-bond-f0type: bondstate: upmtu: 9216link-aggregation:mode: 802.3adoptions:miimon: '100'lacp_rate: 'fast'min_links: '1'port:- <pf_name>- name: ens5f0type: ethernetstate: upmtu: 9216<node_name>specifies the node where the bonded interface is created.mode: 802.3adsets the LACP mode to enable LACP on the bond.lacp_rate: 'fast'sets the LACP rate on the interface. You must also set the rate tofaston the switch. Thefastrate sends LACP packets every second.<pf_name>specifies the PF that you want to include in the bond.
-
Create a YAML file that defines the
NodeNetworkConfigurationPolicyresource for theens5f1interface on theworker-0node:Example nncpBondF1Worker0.yaml fileapiVersion: nmstate.io/v1kind: NodeNetworkConfigurationPolicymetadata:name: example-bond-f1spec:nodeSelector:kubernetes.io/hostname: <node_name>desiredState:interfaces:- name: example-bond-f1description: example-bond-f1type: bondstate: upmtu: 9216link-aggregation:mode: 802.3adoptions:miimon: '100'lacp_rate: 'fast'min_links: '1'port:- <pf_name>- name: ens5f1type: ethernetstate: upmtu: 9216<node_name>specifies the node where the bonded interface is created.mode: 802.3adsets the LACP mode to enable LACP on the bond.lacp_rate: 'fast'sets the LACP rate on the interface. You must also set the rate tofaston the switch. Thefastrate sends LACP packets every second.<pf_name>specifies the PF that you want to include in the bond.
-
Apply the resources by running the following commands:
$ oc apply -f nncpBondF0Worker0.yaml$ oc apply -f nncpBondF1Worker0.yaml
-
-
Create SR-IOV network VFs for the bonded interfaces:
-
Create a YAML file that defines the
SriovNetworkNodePolicyresource for theens5f0interface on theworker-0node:Example sriovnetworkpolicy-port1.yaml fileapiVersion: sriovnetwork.openshift.io/v1kind: SriovNetworkNodePolicymetadata:name: sriovnetpolicy-port-0namespace: openshift-sriov-network-operatorspec:deviceType: netdevicenicSelector:pfNames:- <pf_name>nodeSelector:kubernetes.io/hostname: <node_name>numVfs: <num_vfs>priority: 99resourceName: <resource_name><pf_name>specifies the PF to create the VFs from.<node_name>specifies the node where the VFs are created.<num_vfs>specifies the number of VFs to create on the PF.<resource_name>specifies the resource name used by pods to request these VFs.
-
Create a YAML file that defines the
SriovNetworkNodePolicyresource for theens5f1interface on theworker-0node:Example sriovnetworkpolicy-port2.yaml fileapiVersion: sriovnetwork.openshift.io/v1kind: SriovNetworkNodePolicymetadata:name: sriovnetpolicy-port-1namespace: openshift-sriov-network-operatorspec:deviceType: netdevicenicSelector:pfNames:- <pf_name>nodeSelector:kubernetes.io/hostname: <node_name>numVfs: <num_vfs>priority: 99resourceName: <resource_name><pf_name>specifies the PF to create the VFs from.<node_name>specifies the node where the VFs are created.<num_vfs>specifies the number of VFs to create on the PF.<resource_name>specifies the resource name used by pods to request these VFs.
-
Apply the resources by running the following commands:
$ oc apply -f sriovnetworkpolicy-port1.yaml$ oc apply -f sriovnetworkpolicy-port2.yaml
-
-
Configure the PF Status Relay Operator:
-
Create a YAML file that defines the
PFLACPMonitorresource. This example file configures the Operator to monitor the LACP status ofens5f0andens5f1bonded interfaces on theworker-0node:Example pflacpmonitor.yaml fileapiVersion: pfstatusrelay.openshift.io/v1alpha1kind: PFLACPMonitormetadata:namespace: openshift-pf-status-relay-operatorlabels:app.kubernetes.io/name: pf-status-relay-operatorname: pflacpmonitor-worker-0spec:interfaces:- <pf_name>- <pf_name>pollingInterval: <polling_interval>nodeSelector:kubernetes.io/hostname: <node_name><pf_name>specifies the physical functions to monitor.<polling_interval>specifies the polling interval in milliseconds to check the LACP status on the monitored interfaces. The minimum value is1000.<node_name>specifies the node for the target interfaces.
warningUse only one
PFLACPMonitorcustom resource to monitor each network interface on a node. If you create multiple resources that target the same interface, the PF Status Relay Operator will not process the conflicting configurations. -
Apply the
PFLACPMonitorresource by running the following command:$ oc apply -f pflacpmonitor.yaml
-
Verification
-
Check the logs of the PF Status Relay Operator to verify that it is monitoring the LACP state:
$ oc logs -n openshift-pf-status-relay-operator <pf_status_relay_operator_pod_name>Example output{"time":"2025-07-24T13:35:54.653201692Z","level":"INFO","msg":"lacp is up","interface":"ens5f0"}{"time":"2025-07-24T13:35:54.65347273Z","level":"INFO","msg":"vf link state was set","id":0,"state":"auto","interface":"ens5f0"}... -
Apply the
SriovNetworkresources to make the VFs available for use within thesriov-operator-testsnamespace:- Create a YAML file that defines the
SriovNetworkresource for the VFs created onens5f0:Example sriovnetwork-port1.yaml fileapiVersion: sriovnetwork.openshift.io/v1kind: SriovNetworkmetadata:name: sriovnetwork-port0namespace: openshift-sriov-network-operatorspec:capabilities: '{ "mac": true }'networkNamespace: sriov-operator-testsresourceName: resourceport0 - Create a YAML file that defines the
SriovNetworkresource for the VFs created onens5f1:Example sriovnetwork-port2.yaml fileapiVersion: sriovnetwork.openshift.io/v1kind: SriovNetworkmetadata:name: sriovnetwork-port1namespace: openshift-sriov-network-operatorspec:capabilities: '{ "mac": true }'networkNamespace: sriov-operator-testsresourceName: resourceport1 - Apply the resources by running the following commands:
$ oc apply -f sriovnetwork-port1.yaml$ oc apply -f sriovnetwork-port2.yaml
- Create a YAML file that defines the
-
Define a high-availability pod that uses the SR-IOV VFs:
-
Apply the
NetworkAttachmentDefinitionresource to create anactive-backupbond using the two SR-IOV networks:Example nad-bond.yaml fileapiVersion: k8s.cni.cncf.io/v1kind: NetworkAttachmentDefinitionmetadata:name: nad-bond-1namespace: sriov-operator-testsspec:config: |-{"type": "bond", "cniVersion": "0.3.1", "name": "bond-net1","mode": "active-backup", "failOverMac": 1, "linksInContainer": true, "miimon": "100", "mtu": 1450,"links": [{"name": "net1"},{"name": "net2"}], "capabilities": {"ips": true}, "ipam": {"type": "static"}}-
linksInContainer: truecreates the bond inside the pod’s network namespace. -
mode: active-backupconfigures the bond to use active-backup mode. -
linksspecifies the pod-level interfaces to include in the bond.warningThe PF Status Relay Operator provides LACP state monitoring for pod-level bonding with the
mode: active-backupconfiguration only.
-
-
Apply the
NetworkAttachmentDefinitionresource by running the following command:$ oc apply -f nad-bond.yaml -
Create a YAML file that defines the
Podresource that uses the VFs from the bonded interfaces in active-backup mode:Example client-bond.yaml fileapiVersion: v1kind: Podmetadata:name: client-bondnamespace: sriov-operator-testsannotations:k8s.v1.cni.cncf.io/networks: |-[{"name": "sriovnetwork-port0","interface": "net1","mac": "<mac_address>"},{"name": "sriovnetwork-port1","interface": "net2","mac": "<mac_address>"},{"name": "nad-bond-1","interface": "bond0","ips": ["192.168.10.254/24","2001:100::254/64"],"mac": "<mac_address>"}]spec:nodeName: worker-0containers:- name: client-bondimage: quay.io/nginx/nginx-unprivilegedimagePullPolicy: IfNotPresentcommand: ["/bin/sh", "-c", "sleep 3650d"]securityContext:privileged: truecommand: ["/bin/sleep", "3650d"]- The
k8s.v1.cni.cncf.io/networksannotation requests three networks: two SR-IOV VFs,net1andnet2, and one bond,bond0, which uses them.
- The
-
Apply the
Podresource by running the following command:$ oc apply -f client-bond.yaml
-
-
Check that the failover mechanism:
-
Log in to the
client-bondpod by running the following command:$ oc rsh -n sriov-operator-tests client-bond -
Check the initial status of the pod-level bond by running the following command:
sh-4.4# cat /proc/net/bonding/bond0Example output[root@client-bond-tlb /]# cat /proc/net/bonding/bond0...Bonding Mode: transmit load balancingTransmit Hash Policy: layer2 (0)Primary Slave: NoneCurrently Active Slave: net1MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Peer Notification Delay (ms): 0Slave Interface: net1MII Status: upSpeed: 25000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: AA:BB:CC:DD:EE:FFSlave queue ID: 0Slave Interface: net2MII Status: upSpeed: 25000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: BB:CC:DD:EE:FF:GG- Both
net1andnet2interfaces are up.
- Both
-
Exit the pod shell.
-
Simulate an LACP failure on your upstream physical switch. To simulate this scenario, you can filter LACP traffic on the switch port that you want to test the failure on. This ensures that the physical link remains up while the LACP polling fails. The command to do this is vendor-dependent.
-
Verify the failover inside the pod by logging back into the
client-bondpod and checking the bond status again:sh-4.4# cat /proc/net/bonding/bond0Example output...Bonding Mode: transmit load balancingTransmit Hash Policy: layer2 (0)Primary Slave: NoneCurrently Active Slave: net2MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 0Down Delay (ms): 0Peer Notification Delay (ms): 0Slave Interface: net1MII Status: downSpeed: UnknownDuplex: UnknownLink Failure Count: 1Permanent HW addr: AA:BB:CC:DD:EE:FFSlave queue ID: 0Slave Interface: net2MII Status: upSpeed: 25000 MbpsDuplex: fullLink Failure Count: 0Permanent HW addr: BB:CC:DD:EE:FF:GGSlave queue ID: 0- The
net1interface is down, and thenet2interface is now the active interface. The client-bond pod detects the link state change and switches to the backup network path.
- The
-