The following steps show how to create multiple VFs by using a single physical function (PF), which is a single network device present in the compute node:
[core@csah ~]$ oc create namespace openshift-sriov-network-operator
[core@csah ~]$ oc get pods
NAME READY STATUS RESTARTS AGE
nfd-operator-55487fd584-4rwj9 1/1 Running 0 41s
Note: Ensure that the project is set to openshift-sriov-network-operator and select Install.
[core@csah ~]$ oc get pods -n openshift-sriov-network-operator
Note: The output lists all the compute nodes that are part of the cluster. This guide shows examples for only one compute node. Use the same steps on other compute nodes also.
[core@csah sriov]$ oc get SriovNetworkNodeState compute-1.example.com -o yaml -n openshift-sriov-network-operator
Note: The command output includes information about the deviceID, pciAddress, and vendor for each NIC. For a list of supported network devices for SR-IOV, see About Single Root I/O Virtualization (SR-IOV) hardware networks.
[core@csah sriov]$ oc create -f <YAML file>
Note: In the sample YAML file, five virtual functions are created in each interface eno1 and eno2.
[core@csah sriov]$ oc get sriovnetworknodepolicies compute-1-network-node-policy
NAME AGE
compute-1-network-node-policy 33s
The compute-1.example.com node reboots to apply the network node policy.
To test the functionality, the NICs that are used as part of network node policy are connected to a separate VLAN 150 created in S5232F-1, S5232F-2 with IP address 192.168.150.1/24 and 192.168.150.2/24.
[core@csah sriov]$ oc create -f <YAML file>
[core@csah sriov]$ oc get sriovnetwork
NAME AGE
compute-1-vf0-sriov-network 8s
The IP address 192.168.150.51/24 is assigned to the network device.
[core@csah sriov]$ oc create -f <YAML file>
[core@csah sriov]$ oc get pod compute-1-pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
compute-1-pod 1/1 Running 0 5m21s 10.131.2.8 compute-1.example.com <none> <none>
[core@csah sriov]$ oc exec -it compute-1-pod -- ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
3: eth0@if41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default
link/ether 0a:58:0a:83:02:08 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.131.2.8/23 brd 10.131.3.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::8c0b:d0ff:fe54:d04d/64 scope link
valid_lft forever preferred_lft forever
37: net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether da:b0:ca:69:be:b2 brd ff:ff:ff:ff:ff:ff
inet 192.168.150.51/24 brd 192.168.150.255 scope global net1
valid_lft forever preferred_lft forever
inet6 fe80::d8b0:caff:fe69:beb2/64 scope link
valid_lft forever preferred_lft forever
[core@csah sriov]$ oc exec -it compute-1-pod -- ping 192.168.150.1
PING 192.168.150.1 (192.168.150.1) 56(84) bytes of data.
64 bytes from 192.168.150.1: icmp_seq=1 ttl=64 time=0.308 ms
64 bytes from 192.168.150.1: icmp_seq=2 ttl=64 time=0.337 ms
64 bytes from 192.168.150.1: icmp_seq=3 ttl=64 time=0.307 ms
^C
--- 192.168.150.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2078ms
rtt min/avg/max/mdev = 0.307/0.317/0.337/0.020 ms
[core@csah sriov]$ oc exec -it compute-1-pod -- ping 192.168.150.2
PING 192.168.150.2 (192.168.150.2) 56(84) bytes of data.
64 bytes from 192.168.150.2: icmp_seq=1 ttl=64 time=0.480 ms
64 bytes from 192.168.150.2: icmp_seq=2 ttl=64 time=0.340 ms
64 bytes from 192.168.150.2: icmp_seq=3 ttl=64 time=0.304 ms
64 bytes from 192.168.150.2: icmp_seq=4 ttl=64 time=0.387 ms
^C
--- 192.168.150.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3101ms
rtt min/avg/max/mdev = 0.304/0.377/0.480/0.070 ms