interface name eth1 does not come back after lxc-stop

Bug #764278 reported by Ulli Horlacher
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: lxc

This bug-report is for lxc 0.6.5-1 on Ubuntu 10.04.2.

I (must) use lxc with physical interface configuration (eth1 in my
example).

Inside the container there is a Ubuntu 10.04.2, too.

I can start the container, connect to it, networking works, etc.
Everything looks ok. But when I stop the container and try to restart it,
eth1 is no more available and restarting fails. I must reboot the host to
have eth1 back.

root@zoo:/lxc# grep network ubuntu.cfg
lxc.network.type = phys
lxc.network.link = eth1
lxc.network.flags = up
lxc.network.name = eth0
lxc.network.mtu = 1500
lxc.network.ipv4 = 129.69.1.219/24

root@zoo:/lxc# ethtool eth1
Settings for eth1:
        Supported ports: [ TP ]
        Supported link modes: 10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes: 10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Link partner advertised link modes: Not reported
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes

root@zoo:/lxc# l /proc/sys/net/ipv4/conf/
dRWX - 2011-04-13 08:15 /proc/sys/net/ipv4/conf/all
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/br0
dRWX - 2011-04-13 08:15 /proc/sys/net/ipv4/conf/default
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth0
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth1
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth2
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth3
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth4
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth5
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth6
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth7
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth8
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth9
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/lo
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/virbr0

root@zoo:/lxc# lxc-start -d -f ubuntu.cfg -n ubuntu

root@zoo:/lxc# lxc-console -n ubuntu

Type <Ctrl+a q> to exit the console
root@ubuntu:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:50:56:8e:00:22
          inet addr:129.69.1.219 Bcast:129.69.1.255 Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fe8e:22/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:98 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6675 (6.6 KB) TX bytes:1386 (1.3 KB)

root@zoo:/lxc# lxc-stop -n ubuntu

root@zoo:/lxc# lxc-start -f ubuntu.cfg -n ubuntu
lxc-start: failed to retrieve the index for eth1
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 'ubuntu'
lxc-start: No such file or directory - failed to remove cgroup '/cgroup/ubuntu'

root@zoo:/lxc# ethtool eth1
Settings for eth1:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available

root@zoo:/lxc# l /proc/sys/net/ipv4/conf/
dRWX - 2011-04-13 08:15 /proc/sys/net/ipv4/conf/all
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/br0
dRWX - 2011-04-13 08:15 /proc/sys/net/ipv4/conf/default
dRWX - 2011-04-13 08:20 /proc/sys/net/ipv4/conf/dev3
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth0
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth2
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth3
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth4
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth5
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth6
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth7
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth8
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/eth9
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/lo
dRWX - 2011-04-13 08:17 /proc/sys/net/ipv4/conf/virbr0

As you can see: eth1 is now dev3 and lxc does not rename it back. I cannot
restart the container without eth1, I have to reboot the host. This is a
complete show stopper for lxc and makes it useless.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug. Unfortunately, lxc is not supported on lucid, and no longer works with lucid's kernel at all.

What you are seeing is fixed in newer kernels. If you update to a backported natty or oneiric kernel, it should be fixed. If not, please do reply to this bug.

Changed in lxc (Ubuntu):
status: New → Invalid
Revision history for this message
Ulli Horlacher (framstag) wrote : Re: [Bug 764278] Re: interface name eth1 does not come back after lxc-stop

On Thu 2011-07-28 (14:49), Serge Hallyn wrote:

> Thanks for reporting this bug. Unfortunately, lxc is not supported on
> lucid, and no longer works with lucid's kernel at all.

Why is it in Ubuntu 10.04 universe repository?

http://packages.ubuntu.com/lucid/lxc

A software which does not work "at all" should be removed.

> What you are seeing is fixed in newer kernels. If you update to a
> backported natty or oneiric kernel, it should be fixed.

Yes, this workaround works, but should be at least documented in
http://packages.ubuntu.com/lucid/lxc

--
Ullrich Horlacher Server- und Arbeitsplatzsysteme
Rechenzentrum E-Mail: <email address hidden>
Universitaet Stuttgart Tel: ++49-711-685-65868
Allmandring 30 Fax: ++49-711-682357
70550 Stuttgart (Germany) WWW: http://www.rus.uni-stuttgart.de/

Revision history for this message
Evan Wies (neomantra) wrote :

I'm seeing this on Precise 12.04.1, but with newer kernels and lxc (from precise-backports). I have not tried vanilla precise kernel/lxc.

# uname -a
Linux lotus2 3.5.0-21-generic #32~precise1-Ubuntu SMP Thu Dec 13 20:26:47 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

# dpkg -l | grep lxc
ii liblxc0 0.8.0~rc1-4ubuntu38~ubuntu12.04.1 Linux Containers userspace tools (library)
ii lxc 0.8.0~rc1-4ubuntu38~ubuntu12.04.1 Linux Containers userspace tools

It is easy to reproduce if you'd like me to try something.

Revision history for this message
Evan Wies (neomantra) wrote :

So I took the plunge and installed the LXC Daily builds PPA.... the problem is NOT present in this package version. No other changes were made.

0.9.0~alpha2-0ubuntu1+b1~bzr1075-25~201301101850~precise1

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Evan,

please see bug 1086244. I suspect it's the one you want.

The fix can be SRUd to precise as soon as it lands in raring with the 0.9 merge.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(Obviously I was either misreading or just thinking wrongly when I said this was a kernel bug and fixed in comment #1)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.