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.
π‘ Quick Answer: Define a
SriovNetworkNodePolicywith the target PFs andnumVfs, apply it inopenshift-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.yamlVerify Reconciliation
oc -n openshift-sriov-network-operator get sriovnetworknodestate
oc -n openshift-sriov-network-operator get sriovnetworknodestate worker-a -o yamlVerify 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
rootDevicesorpfNamesto avoid selecting unintended NICs.

Recommended
Kubernetes Recipes β The Complete Book100+ production-ready patterns with detailed explanations, best practices, and copy-paste YAML. Everything in one place.
Get the Book βLearn by Doing
CopyPasteLearn β Hands-on Cloud & DevOps CoursesMaster Kubernetes, Ansible, Terraform, and MLOps with interactive, copy-paste-run lessons. Start free.
Browse Courses βπ Deepen Your Skills β Hands-on Courses
Courses by CopyPasteLearn.com β Learn IT by Doing
