Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does sriov-cni not support assigning multiple VFS to Pods #310

Open
ferris-cx opened this issue Sep 11, 2024 · 2 comments
Open

Why does sriov-cni not support assigning multiple VFS to Pods #310

ferris-cx opened this issue Sep 11, 2024 · 2 comments

Comments

@ferris-cx
Copy link

When a pod applies for 2 VF, only one net network interface can be seen inside the pod, and 2 are expected. What is the reason? Is there a limit to the sriov-cni version? Is it only supported by a higher version?
1、pod.yaml如下:
apiVersion: v1
kind: Pod
metadata:
name: pod-vf2
annotations:
k8s.v1.cni.cncf.io/networks: sriov-attach-ens11f1np1
spec:
containers:

  • name: container-vf2
    image: centos/tools
    command: [ "/bin/bash", "-c", "--" ]
    args: [ "while true; do sleep 300000; done;" ]
    resources:
    requests:
    cpu: 1
    memory: 1Gi
    koordinator.sh/rdma: '2'
    limits:
    cpu: 1
    memory: 1Gi
    koordinator.sh/rdma: '2'

2、NAD定义如下:
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: sriov-attach-ens11f1np1
namespace: default
annotations:
k8s.v1.cni.cncf.io/resourceName: mellanox.com/rdma
spec:
config: '{
"cniVersion": "0.3.1",
"name": "sriov-attach",
"type": "sriov",
"capabilities": {
"mac": true,
"ipam": true
},
"master": "ens11f1np1",
"mode": "bridge",
"ipam": {
"type": "host-local",
"subnet": "10.10.10.0/24"
}
}'
3、RDMA NIC name of node1:ens11f1np1

@xxsoul
Copy link

xxsoul commented Dec 5, 2024

In this scenario, you need to declare two network interfaces, for example:
[这种场景下,你需要声明两个网络接口,例如]:
metadata:
name: pod-vf2
annotations:
k8s.v1.cni.cncf.io/networks: sriov-attach-ens11f1np1@ens11f1np0,k8s.v1.cni.cncf.io/networks: sriov-attach-ens11f1np1@ens11f1np1
In addition, the two VFs assigned to the Pod need to come from two PFs; after all, the same physical NIC device cannot be used twice for the same Pod
[另外,分配给Pod的两个VF需要来自于两个PF,毕竟同一个物理NIC设备不能给同一个Pod用两次]

@SchSeba
Copy link
Collaborator

SchSeba commented Dec 31, 2024

Thanks @xxsoul that is the right answer!

@ferris-cx let me know if I can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants