// Module included in the following assemblies:
//
// * networking/hardware_networks/about-sriov.adoc
// * virt/vm_networking/virt-connecting-vm-to-sriov.adoc

:_mod-docs-content-type: REFERENCE
[id="discover-sr-iov-devices_{context}"]
= Automated discovery of SR-IOV network devices

[role="_abstract"]
The SR-IOV Network Operator searches your cluster for SR-IOV capable network devices on worker nodes.
The Operator creates and updates a `SriovNetworkNodeState` custom resource (CR) for each worker node that provides a compatible SR-IOV network device.

The CR is assigned the same name as the worker node.
The `status.interfaces` list provides information about the network devices on a node.

[IMPORTANT]
====
Do not modify a `SriovNetworkNodeState` object.
The Operator creates and manages these resources automatically.
====

The following YAML is an example of a `SriovNetworkNodeState` object created by the SR-IOV Network Operator:

[source,yaml]
----
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodeState
metadata:
  name: node-25
  namespace: openshift-sriov-network-operator
  ownerReferences:
  - apiVersion: sriovnetwork.openshift.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: SriovNetworkNodePolicy
    name: default
spec:
  dpConfigVersion: "39824"
status:
  interfaces:
  - deviceID: "1017"
    driver: mlx5_core
    mtu: 1500
    name: ens785f0
    altNames:
    - production-nic
    pciAddress: "0000:18:00.0"
    totalvfs: 8
    vendor: 15b3
  - deviceID: "1017"
    driver: mlx5_core
    mtu: 1500
    name: ens785f1
    pciAddress: "0000:18:00.1"
    totalvfs: 8
    vendor: 15b3
  - deviceID: 158b
    driver: i40e
    mtu: 1500
    name: ens817f0
    pciAddress: 0000:81:00.0
    totalvfs: 64
    vendor: "8086"
  - deviceID: 158b
    driver: i40e
    mtu: 1500
    name: ens817f1
    pciAddress: 0000:81:00.1
    totalvfs: 64
    vendor: "8086"
  - deviceID: 158b
    driver: i40e
    mtu: 1500
    name: ens803f0
    pciAddress: 0000:86:00.0
    totalvfs: 64
    vendor: "8086"
  syncStatus: Succeeded
----

--
* The value of the `name` field is the same as the name of the worker node.
* The `interfaces` stanza includes a list of all of the SR-IOV devices discovered by the Operator on the worker node.
* The `altNames` field lists any alternative interface names configured through the Kubernetes NMState Operator. You can use these names in the `nicSelector.pfNames` field of a `SriovNetworkNodePolicy` CR.
--
