πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Networking intermediate ⏱ 25 minutes K8s 1.28+

Create SR-IOV VFs on OpenShift with SriovNetworkNodePolicy

Use the OpenShift SR-IOV Network Operator to create and manage Virtual Functions from selected Physical Functions on GPU worker nodes.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: Define a SriovNetworkNodePolicy with the target PFs and numVfs, apply it in openshift-sriov-network-operator, and verify VF resources appear in node allocatable.

OpenShift creates and reconciles VFs through SriovNetworkNodePolicy. Avoid manual VF creation for production clusters.

Example Node Policy

apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
  name: cx7-policy
  namespace: openshift-sriov-network-operator
spec:
  resourceName: mellanoxnics
  nodeSelector:
    kubernetes.io/hostname: "worker-a"
  priority: 90
  numVfs: 16
  mtu: 1500
  deviceType: netdevice
  isRdma: true
  nicSelector:
    rootDevices:
      - "0000:b5:00.0"
      - "0000:db:00.0"
    vendor: "15b3"
    deviceID: "1021"

Apply:

oc apply -f sriov-node-policy.yaml

Verify Reconciliation

oc -n openshift-sriov-network-operator get sriovnetworknodestate
oc -n openshift-sriov-network-operator get sriovnetworknodestate worker-a -o yaml

Verify Resources Exposed to Scheduler

oc get node worker-a -o json | jq '.status.allocatable'

Expect an extended resource key like:

  • openshift.io/mellanoxnics

Notes

  • Use worker nodes only, not control-plane nodes.
  • Keep PFs dedicated for SR-IOV workloads.
  • Prefer explicit rootDevices or pfNames to avoid selecting unintended NICs.
#openshift #sriov #vf #network-operator #mellanox
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens