[PVE-User] PVE 4.1 how to passthrough Nic to LXC

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Jan 20 10:14:25 CET 2016


> On January 20, 2016 at 1:22 AM Chris Hsiang <elurex at gmail.com> wrote:
> 
> 
> Anyone knows how to pass sr-iov VF Nic to LXC in pve 4.1?
> 
> The VF nic highlight in *** are the ones that I want to pass to LXC
> Code:
> 
> root at 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/

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.




More information about the pve-user mailing list