Serverside veth not clean shutdown on container reboot or shutdown

Hello,

currently i have problems if a container restarts an connections to this container are active.
The veth on hostside is LOWERLAYERDOWN and the container doesn’t start. Is there a key in systctl.conf or eg. to prevent this ?

I’m experiencing the same phenomena. The veth devices will sometimes need to be manually deleted.

Syslog complains with:

Could not generate persistent MAC address for vethO8CL0K: No such file or directory

LXC complains with:

lxc marvin 20190321184345.478 ERROR network - network.c:instantiate_veth:106 - Operation not permitted - Failed to create veth pair "veth-marvin" and "vethY30VPI"
lxc marvin 20190321184345.478 ERROR network - network.c:lxc_create_network_priv:2457 - Failed to create network device
lxc marvin 20190321184345.478 ERROR start - start.c:lxc_spawn:1626 - Failed to create the network
lxc marvin 20190321184345.478 ERROR start - start.c:__lxc_start:1939 - Failed to spawn container "marvin"
lxc marvin 20190321184345.478 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:842 - Received container state "STOPPING" instead of "RUNNING"
lxc 20190321184345.487 WARN commands - commands.c:lxc_cmd_rsp_recv:132 - Connection reset by peer - Failed to receive response for command "get_state"

LXC info:

driver: lxc
driver_version: 3.0.3
kernel: Linux
kernel_architecture: x86_64
kernel_version: 4.15.0-46-generic
server: lxd
server_pid: 2134
server_version: 3.0.3
storage: ceph
storage_version: ceph version 14.2.0 (3a54b2b6d167d4a2a19e003a705696d4fe619afc)
nautilus (stable)
server_clustered: true
server_name: cyrus
project: “”

Yes i can delete the interface manualy but this doesn’t solve my problem. If i run a debian 8 Container, Connect via ssh and reboot it he came naver back online. I have found a solution to solve this with a netdown script. But netdown scripts are not supported anymore. -.-

That’s usually an indication that the network namespace of your container never expired, which normally indicates an issue with the kernel.

When the last process using a network namespace goes away, the namespace is destroyed, which causes all virtual interfaces to be destroyed and physical interfaces to be moved back to the host network namespace.

veth is a virtual device, the network namespace expiring will cause the container side device to be deleted, which then causes the host side device to also be deleted.

What you’re reporting here is consistent with the container’s network namespace still being active, keeping that veth device around.

Ok is there a workaround to solve this problem ?

Hello,

i have found a workaround to solve my Problem. I have removed the static interface name on serverside. After reboot lxc create a new veth interface and the old time out after a few minutes. But this create a new Problem with a dynamic interface i can not read traffic via snmp for rrd graphs. Because it’s change the name on every reboot.