Wednesday, April 3, 2019

LInux Containers -- lxc_conf - conf.c:instantiate_veth:2801 - failed to attach 'veth25UALU' to the bridge 'lxcbr0': Operation not permitted

Problem

You are starting a linux container and get errors similar to below:

# lxc-start -n racnode2 -d -o /container/racnode2_debug.log -l DEBUG

lxc-start 1554298339.260 ERROR    lxc_conf - conf.c:instantiate_veth:2801 - failed to attach 'veth25UALU' to the bridge 'lxcbr0': Operation not permitted
lxc-start 1554298339.274 ERROR    lxc_conf - conf.c:lxc_create_network:3084 - failed to create netdev
lxc-start 1554298339.274 ERROR    lxc_start - start.c:lxc_spawn:935 - failed to create the network
lxc-start 1554298339.274 ERROR    lxc_start - start.c:__lxc_start:1192 - failed to spawn 'racnode2'

Solution

Check if lxcbr0 is created: 

# brctl show
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.5254005aedff       yes             virbr0-nic

Create lxcbr0 with  brctl addbr lxcbr0 and start the container:

# brctl addbr lxcbr0
# brctl show
bridge name     bridge id               STP enabled     interfaces
lxcbr0          8000.000000000000       no
virbr0          8000.5254005aedff       yes             virbr0-nic

# lxc-start -n racnode2 -d -o /container/racnode2_debug.log -l DEBUG

No comments: