Verified on a bare-metal cluster with the following attributes:
OCP: 4.11.0-rc.6
NetworkManager on host: 1.36.0-7.el8_6
NetworkManager on nmstate-handler pod: 1.30.0-8.el8_4
nmstate: 1.2.1-3.el8_6.x86_64
sriov-network-operator.4.11.0-202208031703
Red Hat Enterprise Linux CoreOS 411.86.202207260413-0
RHEL 8.6
Reproduced the following way:
1. On an bare-metal cluster which has nmstate and SR-IOV installed - apply the following SRIOV policy, which defines 10 VFs on a PF interface:
$ cat << EOF | oc apply -f -
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
name: test-sriov-policy
namespace: openshift-sriov-network-operator
spec:
deviceType: vfio-pci
mtu: 9000
nicSelector:
pfNames:
- enp161s0f0
rootDevices:
- 0000:a1:00.0
nodeSelector:
feature.node.kubernetes.io/network-sriov.capable: "true"
numVfs: 10
priority: 99
resourceName: sriov_net
EOF
2. Apply the following policy, which sets a static IPv4 address on the same PF interface:
$ cat << EOF | oc apply -f -
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: ip-on-pf
spec:
desiredState:
interfaces:
- ipv4:
address:
- ip: 10.1.156.18
prefix-length: 24
auto-dns: true
dhcp: false
enabled: true
ipv6:
dhcp: false
enabled: false
name: enp161s0f0
state: up
type: ethernet
nodeSelector:
kubernetes.io/hostname: cnv-qe-infra-25.cnvqe2.lab.eng.rdu2.redhat.com
EOF
* Make sure to:
- change the value of nodeSelector to a name of a node in your cluster
- change the interface name to the name of the PF interface in your cluster node
3. Wait to see that policy was configured successfully:
$ oc get nncp -w
NAME STATUS REASON
ip-on-pf Available SuccessfullyConfigured
4. Verify the IP address configured in the NNCP in step 2 was successfully applied on the interface:
$ oc get nns cnv-qe-infra-25.cnvqe2.lab.eng.rdu2.redhat.com -ojsonpath={.status.currentState.interfaces[?(@.name==\"enp161s0f0\")].ipv4.address} | jq
[
{
"ip": "10.1.156.18",
"prefix-length": 24
},
]
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2022:6442
Verified on a bare-metal cluster with the following attributes: OCP: 4.11.0-rc.6 NetworkManager on host: 1.36.0-7.el8_6 NetworkManager on nmstate-handler pod: 1.30.0-8.el8_4 nmstate: 1.2.1-3.el8_6.x86_64 sriov-network-operator.4.11.0-202208031703 Red Hat Enterprise Linux CoreOS 411.86.202207260413-0 RHEL 8.6 Reproduced the following way: 1. On an bare-metal cluster which has nmstate and SR-IOV installed - apply the following SRIOV policy, which defines 10 VFs on a PF interface: $ cat << EOF | oc apply -f - apiVersion: sriovnetwork.openshift.io/v1 kind: SriovNetworkNodePolicy metadata: name: test-sriov-policy namespace: openshift-sriov-network-operator spec: deviceType: vfio-pci mtu: 9000 nicSelector: pfNames: - enp161s0f0 rootDevices: - 0000:a1:00.0 nodeSelector: feature.node.kubernetes.io/network-sriov.capable: "true" numVfs: 10 priority: 99 resourceName: sriov_net EOF 2. Apply the following policy, which sets a static IPv4 address on the same PF interface: $ cat << EOF | oc apply -f - apiVersion: nmstate.io/v1 kind: NodeNetworkConfigurationPolicy metadata: name: ip-on-pf spec: desiredState: interfaces: - ipv4: address: - ip: 10.1.156.18 prefix-length: 24 auto-dns: true dhcp: false enabled: true ipv6: dhcp: false enabled: false name: enp161s0f0 state: up type: ethernet nodeSelector: kubernetes.io/hostname: cnv-qe-infra-25.cnvqe2.lab.eng.rdu2.redhat.com EOF * Make sure to: - change the value of nodeSelector to a name of a node in your cluster - change the interface name to the name of the PF interface in your cluster node 3. Wait to see that policy was configured successfully: $ oc get nncp -w NAME STATUS REASON ip-on-pf Available SuccessfullyConfigured 4. Verify the IP address configured in the NNCP in step 2 was successfully applied on the interface: $ oc get nns cnv-qe-infra-25.cnvqe2.lab.eng.rdu2.redhat.com -ojsonpath={.status.currentState.interfaces[?(@.name==\"enp161s0f0\")].ipv4.address} | jq [ { "ip": "10.1.156.18", "prefix-length": 24 }, ]