[lxc-users] Eth0 not present on boot

Fajar A. Nugraha list at fajar.net
Wed Sep 23 01:40:37 UTC 2015


On Wed, Sep 23, 2015 at 8:24 AM, Peter Steele <pwsteele at gmail.com> wrote:
> On 09/22/2015 08:08 AM, Guido Jäkel wrote:
>>
>> * Do you use  lxc.network.veth.pair  to name the hosts side of the veth?
>
> Yes. I rename the veth interfaces to match the names of the containers.
>>
>> * Was the Container up and running "just before" and you (re)start it
>> within less than 5min?
>>
> Yes. When the problem occurs, a reboot has just been issued on the container
> (using the "reboot" command). When the container restarts, its eth0 is
> missing. Another reboot and the eth0 interface reappears. Curiously, it
> appears to happen much more frequently on some hardware than it does on
> others.

Can you reproduce this on demand? If yes, try force-deleting the veth
interface with hook script, and see if works now.

In the past, when I run "reboot" inside the container when using
persistent veth name, it failed to start with "interface already
exist" (or something similar, can't remember the exact message). I use
this as a workaround:


### on container config
lxc.network.veth.pair = veth-blah-0
lxc.network.script.down = /etc/lxc/script/net-down

### on /etc/lxc/script/net-down
#!/bin/bash
/sbin/ip link del "$5"


If you wonder what "$5" means, run "man lxc.container.conf" to see
what parameters are passed to lxc.network.script.down

It's curious that you manage to use persistent veth name AND manage to
reboot from inside the container. Perhaps the problem was fixed
recently. However if you CAN reproduce the problem on demand, you
might still want to try the above workaround just to make sure.

-- 
Fajar


More information about the lxc-users mailing list