[lxc-users] Remaining virtual ethernet interfaces (veth) after container has been deleted

steven prothero steven at marimo-tech.com
Fri Mar 27 01:20:58 UTC 2020


Possible somewhat related:

https://discuss.linuxcontainers.org/t/is-there-a-way-to-pass-other-config-transient-true-to-vswitch/6354
https://github.com/lxc/lxd/issues/1596
https://github.com/lxc/lxc/issues/2849
https://github.com/lxc/lxc/issues/3137
https://github.com/lxc/lxc/issues/2913
https://github.com/lxc/lxc/issues/590
https://discuss.linuxcontainers.org/t/vethxxxxx-interfaces-are-not-removed-when-lxc-container-is-stopped/4816
https://discuss.linuxcontainers.org/t/serverside-veth-not-clean-shutdown-on-container-reboot-or-shutdown/4379
https://developers.redhat.com/blog/2017/12/01/open-vswitch-without-stale-ports/

I am using open vswitch and experience this issue also.


On Fri, Mar 27, 2020 at 3:36 AM Mike Wright <nobody at nospam.hostisimo.com> wrote:
>
> On 3/26/20 8:14 AM, Sebert, Holger.ext wrote:
> > Hi,
> >
> > we use LXD containers on our CI-build nodes. For each build a container is
> > created and deleted afterwards. So, container creation and deletion happens
> > quite often.
> >
> > Here is the problem: After some time, many virtual ethernet interfaces (veth*)
> > accumulate, they look like this:
> >
> > vethY59JK1 Link encap:Ethernet  HWaddr fe:12:cc:54:20:70
> >                 inet6 addr: fe80::fc12:ccff:fe54:2070/64 Scope:Link
> >                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> >                 RX packets:60 errors:0 dropped:0 overruns:0 frame:0
> >                 TX packets:14095 errors:0 dropped:0 overruns:0 carrier:0
> >                 collisions:0 txqueuelen:1000
> >                 RX bytes:6735 (6.7 KB)  TX bytes:2417738 (2.4 MB)
> >
> > ...
> >
> > vethYCP720 Link encap:Ethernet  HWaddr fe:6c:d0:78:b0:63
> >                 inet6 addr: fe80::fc6c:d0ff:fe78:b063/64 Scope:Link
> >                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
> >                 RX packets:61 errors:0 dropped:0 overruns:0 frame:0
> >                 TX packets:14075 errors:0 dropped:0 overruns:0 carrier:0
> >                 collisions:0 txqueuelen:1000
> >                 RX bytes:6653 (6.6 KB)  TX bytes:2414750 (2.4 MB)
> >
> >
> > These interfaces are not connected to any running container and cannot be
> > removed. It seems to me that they are somehow leftovers from previous
> > containers which don't exist anymore.
>
> Hi Holger,
>
> A technique I use is to give each container's interfaces unique names on
> the host, usually the same name as the container itself.  If there is
> more than one interface I add a digit.
>
> e.g. container "zorro" has a profile named "zorro".  Here is a snip from
> "zorro's" yaml profile:
>
> devices:
>    eth0:
>      host_name: zorro  <--- will show up on the host
>
> An interface cannot be removed while it is up.
>
> ip link set dev zorro down  (short way: ip l s zorro down)
> ip link del dev zorro       (short way: ip l d zorro)
>
> A deleted interface is automagically removed from any bridge it's on.
>
> Mike Wright
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users



-- 
============================================================

本メール及び添付ファイルは、受取人のための特別な秘密情報を含んでいます。
貴殿が発信者の意図された受取人でない場合、ここに含まれる情報の刷出し、複写、流布はお控え下さい。
尚、ここに含まれる情報のいかなる転用も禁止します。誤って貴殿にこのメールが送信された場合、
発信者にご連絡の上、内容をすべて破棄して下さいますようお願い申し上げます。

This message is confidential. It may also be privileged or otherwise
protected by work product immunity or other legal rules.
If you have received it by mistake, please let us know by reply and
then delete it from your system; you should not copy the message or
disclose its contents to anyone.

============================================================

●---------------------------------------------------------------------------------------------●
まりもテクノロジー株式会社
 Steven Prothero   プロセロ  スティーブン

 札幌市中央区北2条西2丁目1番地1 ハクオウビル9F
 TEL:011-252-2008
 FAX:011-351-2979
 steven at marimo-tech.com
●---------------------------------------------------------------------------------------------●

Este correo va dirigido, de manera exclusiva, a su destinatario y puede
contener información confidencial, cuya divulgación no está permitida
por la ley. Si usted no es su destinatario notifíquelo urgentemente al
remitente y borre este correo de su sistema.
Proteja el Medio Ambiente. Evite imprimir este mensaje si no es
estrictamente necesario.

Informacija u ovom e-mailu namenjena je isklju?ivo primaocima
navedenim u adresi poruke. Poruka mo?e sadr?ati poverljive
informacije. Ukoliko gre?kom primite ovaj e-mail, molimo da ga
obri?ete. Ako niste navedeni kao primalac, svako kopiranje kori??enje
i obelodanjivanje sadr?aja je zabranjeno i mo?e biti nezakonito.


More information about the lxc-users mailing list