k8snetworkplumbingwg / sriov-cni

DPDK & SR-IOV CNI plugin
Apache License 2.0
309 stars 146 forks source link

Device name lookup failure in netns #56

Closed zshi-redhat closed 5 years ago

zshi-redhat commented 5 years ago

In commit 63b44a3, device name is changed before moving into container namespace in order to avoid possible name conflicts inside container, for example:

rename 'em1_0' to 'dev13'

but this also causes failure when CNI tries to rename the interface to 'netx' again after it's moved into container, for example:

rename 'em1_0' to 'net1'

because inside container namespace, the interface is not em1_0 anymore, but dev13

error message:

Warning  FailedCreatePodSandBox  6s    kubelet, nfvsdn-17.oot.lab.eng.rdu2.redhat.com  Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "f3264b820129f6786899e648b2ec8808285028edb4a3776b3b70f2aad287014b" network for pod "testpod2": NetworkPlugin cni failed to set up pod "testpod2_default" network: Multus: Err in tearing down failed plugins: Multus: error in invoke Delegate add - "sriov": failed to set up pod interface "net1" from the device "em1": failed to rename vf 0 of the device "em1_0" to "net1": failed to lookup device "em1_0": Link not found, failed to clean up sandbox container "f3264b820129f6786899e648b2ec8808285028edb4a3776b3b70f2aad287014b" network for pod "testpod2": NetworkPlugin cni failed to teardown pod "testpod2_default" network: Multus: error in invoke Delegate del - "sriov": failed to lookup vf device "net1": Link not found]
ahalimx86 commented 5 years ago

Good catch! We need to think about implementing some integration tests to catch this kind of issues that may slip through PR reviews/unit tests.

zshi-redhat commented 5 years ago

Good catch! We need to think about implementing some integration tests to catch this kind of issues that may slip through PR reviews/unit tests.

I think we might want to setup CI for e2e testing in a real kubernetes environment. adding this as a topic in next resource management call.