How to pass SR-IOV VF Nic to LXC in PVE 4.1 ?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

EluRex

Active Member
Apr 28, 2015
218
78
28
Los Angeles, CA
Anyone knows how to pass sr-iov VF Nic to LXC in pve 4.1?

The VF nic highlight in RED are the ones that I want to pass to LXC
Code:
root@pve-dol1:/sys/class/net/eth6/device#  lspci |grep Eth
03:00.0 Ethernet controller: Intel Corporation Ethernet Connection X552/X557-AT 10GBASE-T
03:00.1 Ethernet controller: Intel Corporation Ethernet Connection X552/X557-AT 10GBASE-T
05:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
05:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
05:10.1 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
05:10.3 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
05:10.5 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
05:10.7 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
07:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
07:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
I know first I must set in /etc/pve/lxc/CTID.conf

lxc.cgroup.devices.allow = c XXX:* rwm (where xxx = major *=minor ids)
lxc.mount.entry = /dev/eth0 dev/eth0 none bind,optional,create=file

but I cannot find any VF eth NIC under pve host's /dev/
 

EluRex

Active Member
Apr 28, 2015
218
78
28
Los Angeles, CA
AFAIK they should show up on the host in `ip link` / `ifconfig`, so you should be
able to pass the interface via lxc.network.type+lxc.network.link:
eg. if it's enp5s16f1 (which I think would be the default these days for your pci ids):

lxc.network.type: phys
lxc.network.link: enp5s16f1

Note that the order is important, first .type, then .link.