[Lxc-users] eth0 not coming online in LXC environment
Serge Hallyn
serge.hallyn at ubuntu.com
Wed Apr 10 13:14:46 UTC 2013
Please send exact commands you used to create the contaienr, including
the configuration file send to 'lxc-create -f <file>'.
Quoting David Parks (davidparks21 at yahoo.com):
> I just ran some more tests. We've got 3 servers with LXC on them, and all 3
> servers encounter this same problem, when you reboot a container eth0 is
> down and not visible in /run/network/ifstate (and networking isn't
> configured). Adding eth0=eth0 to that file, manually, and restarting
> networking resolves it. I did send an email a few days ago saying 1 server
> was working, I don't know how it worked once, but I can clearly reproduce it
> now on all servers now.
>
>
>
> The hosts are Ubuntu 12.10 just installed, pretty close to vanilla except
> for the configuration settings below.
>
>
>
> I reproduce the issue on both a vanilla 12.04 container built from the LXC
> template, and on a 12.10 container built from Ubuntu cloud (I was hoping it
> was just an issue with the cloud templates, but no, it seems to be some way
> I'm configuring things on the host I guess).
>
>
>
> Any ideas on my next troubleshooting steps here? It's a royal pain to cycle
> our ~8 containers so I want to address it.
>
>
>
>
>
>
> # Disable lxcbr0 as it's unused.
>
> Edit /etc/default/lxc, set USE_LXC_BRIDGE to false:
>
> # Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your
> # containers. Set to "false" if you'll use virbr0 or another existing
> # bridge, or mavlan to your host's NIC.
> USE_LXC_BRIDGE="false"
>
>
> Disable virbr0 as it's unused (a duplicate of lxcbr0)
>
> virsh net-destroy default
> virsh net-undefine default
>
>
>
>
>
>
>
> From: Fajar A. Nugraha [mailto:list at fajar.net]
> Sent: Friday, April 05, 2013 6:00 PM
> To: David Parks
> Cc: LXC
> Subject: Re: [Lxc-users] eth0 not coming online in LXC environment
>
>
>
> Now that's weird!
>
>
>
> I'm sure Serge would love to get more details about your setup (e.g.
> software versions, how you create the containers, etc). In the mean time, if
> you're using Ubuntu-packaged lxc, can you try:
>
> - apt-get update and upgrade, to make sure you have latest version of kernel
> and lxc
>
> - install new container using ubuntu template: "lxc-create -t ubuntu ...."
>
>
>
> I don't know about ubuntu-cloud template, but the normal ubuntu template
> works fine for me.
>
>
>
> --
>
> Fajar
>
>
>
>
>
> On Fri, Apr 5, 2013 at 4:13 PM, David Parks <davidparks21 at yahoo.com> wrote:
>
> Oops, forgot that important detail, running Ubuntu 12.10 as the host OS
> installed off media, and I have 12.10 running in these LXC containers built
> from the Ubuntu cloud distros (12.10 64bit).
>
>
>
>
>
> From: Fajar A. Nugraha [mailto:list at fajar.net]
> Sent: Friday, April 05, 2013 4:09 PM
> To: David Parks
> Cc: LXC
> Subject: Re: [Lxc-users] eth0 not coming online in LXC environment
>
>
>
> On Fri, Apr 5, 2013 at 10:33 AM, David Parks <davidparks21 at yahoo.com> wrote:
>
> I've got an environment set up now where the host OS has a static IP
> directly connected to the LAN. I'm bridging the containers to have their own
> static LAN IP as well.
>
>
>
> When I start my container eth0 is *not* configured. If I manually add
> `eth0=eth0` in /run/network/ifstate and `service restart networking`, it
> gets configured properly.
>
>
>
>
>
> After looking at dmesg output I noticed that there are (unexpected)
> references to em1, which is the host's physical NIC.
>
>
>
> The bridging all works, networking is fine, it's just when I start the
> container, rebooting reproduces the problem, then manually updating ifstate
> and rebooting resolves it.
>
>
>
> I'm not sure how to configure it so it configure eth0 on reboot as I would
> expect.
>
>
>
> Well, a description on which distro/version you're running as host and
> container would be nice.
>
>
>
> Short version is if you use Ubuntu (preferably quantal/raring for newer lxc
> version, but precise is also fine), then it will just work. If you use some
> other combination (e.g. Centos for container), then be prepared for hickups.
>
>
>
> I had problems with Centos container, and the "fix" was to force-clean
> /var/run and /var/lock/subsys on container startup:
> https://github.com/fajarnugraha/lxc/blob/centos-template/templates/lxc-cento
> s.in#L90
>
>
>
> --
>
> Fajar
>
>
> ----------------------------------------------------------------------------
> --
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
More information about the lxc-users
mailing list