<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText>Aha!<o:p></o:p></p><p class=MsoPlainText>In an attempt to get you the information you requested (and be thorough in doing so) I discovered the problem.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>We statically configure our IPs (e.g. via <span style='font-family:"Courier New"'>/etc/networking/interfaces</span>). We also had defined in the lxc config file:<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText> <span style='font-family:"Courier New"'>lxc.network.ipv4 = 10.1.3.9/16<o:p></o:p></span></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>That appears to be a no-no. When I comment that line out in the config all is well. Problem solved. <o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>I suppose failing to start the container with a well-meaning error message when such a conditions exists would be truly stellar. But I’m happy that it works now!<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Thanks!<o:p></o:p></p><p class=MsoPlainText>Dave<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>-----Original Message-----<br>From: Serge Hallyn [mailto:serge.hallyn@ubuntu.com] <br>Sent: Wednesday, April 10, 2013 8:15 PM<br>To: David Parks<br>Cc: lxc-users@lists.sourceforge.net<br>Subject: Re: [Lxc-users] eth0 not coming online in LXC environment</p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Please send exact commands you used to create the contaienr, including the configuration file send to 'lxc-create -f <file>'.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Quoting David Parks (<a href="mailto:davidparks21@yahoo.com"><span style='color:windowtext;text-decoration:none'>davidparks21@yahoo.com</span></a>):<o:p></o:p></p><p class=MsoPlainText>> I just ran some more tests. We've got 3 servers with LXC on them, and <o:p></o:p></p><p class=MsoPlainText>> all 3 servers encounter this same problem, when you reboot a container <o:p></o:p></p><p class=MsoPlainText>> eth0 is down and not visible in /run/network/ifstate (and networking <o:p></o:p></p><p class=MsoPlainText>> isn't configured). Adding eth0=eth0 to that file, manually, and <o:p></o:p></p><p class=MsoPlainText>> restarting networking resolves it. I did send an email a few days ago <o:p></o:p></p><p class=MsoPlainText>> saying 1 server was working, I don't know how it worked once, but I <o:p></o:p></p><p class=MsoPlainText>> can clearly reproduce it now on all servers now.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> The hosts are Ubuntu 12.10 just installed, pretty close to vanilla <o:p></o:p></p><p class=MsoPlainText>> except for the configuration settings below.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> I reproduce the issue on both a vanilla 12.04 container built from the <o:p></o:p></p><p class=MsoPlainText>> LXC template, and on a 12.10 container built from Ubuntu cloud (I was <o:p></o:p></p><p class=MsoPlainText>> hoping it was just an issue with the cloud templates, but no, it seems <o:p></o:p></p><p class=MsoPlainText>> to be some way I'm configuring things on the host I guess).<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Any ideas on my next troubleshooting steps here? It's a royal pain to <o:p></o:p></p><p class=MsoPlainText>> cycle our ~8 containers so I want to address it.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> # Disable lxcbr0 as it's unused.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Edit /etc/default/lxc, set USE_LXC_BRIDGE to false:<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> # Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your # <o:p></o:p></p><p class=MsoPlainText>> containers. Set to "false" if you'll use virbr0 or another existing # <o:p></o:p></p><p class=MsoPlainText>> bridge, or mavlan to your host's NIC.<o:p></o:p></p><p class=MsoPlainText>> USE_LXC_BRIDGE="false"<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Disable virbr0 as it's unused (a duplicate of lxcbr0)<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> virsh net-destroy default<o:p></o:p></p><p class=MsoPlainText>> virsh net-undefine default<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> From: Fajar A. Nugraha [<a href="mailto:list@fajar.net"><span style='color:windowtext;text-decoration:none'>mailto:list@fajar.net</span></a>]<o:p></o:p></p><p class=MsoPlainText>> Sent: Friday, April 05, 2013 6:00 PM<o:p></o:p></p><p class=MsoPlainText>> To: David Parks<o:p></o:p></p><p class=MsoPlainText>> Cc: LXC<o:p></o:p></p><p class=MsoPlainText>> Subject: Re: [Lxc-users] eth0 not coming online in LXC environment<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Now that's weird!<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> I'm sure Serge would love to get more details about your setup (e.g.<o:p></o:p></p><p class=MsoPlainText>> software versions, how you create the containers, etc). In the mean <o:p></o:p></p><p class=MsoPlainText>> time, if you're using Ubuntu-packaged lxc, can you try:<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> - apt-get update and upgrade, to make sure you have latest version of <o:p></o:p></p><p class=MsoPlainText>> kernel and lxc<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> - install new container using ubuntu template: "lxc-create -t ubuntu ...."<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> I don't know about ubuntu-cloud template, but the normal ubuntu <o:p></o:p></p><p class=MsoPlainText>> template works fine for me.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> --<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Fajar<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> On Fri, Apr 5, 2013 at 4:13 PM, David Parks <<a href="mailto:davidparks21@yahoo.com"><span style='color:windowtext;text-decoration:none'>davidparks21@yahoo.com</span></a>> wrote:<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Oops, forgot that important detail, running Ubuntu 12.10 as the host <o:p></o:p></p><p class=MsoPlainText>> OS installed off media, and I have 12.10 running in these LXC <o:p></o:p></p><p class=MsoPlainText>> containers built from the Ubuntu cloud distros (12.10 64bit).<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> From: Fajar A. Nugraha [<a href="mailto:list@fajar.net"><span style='color:windowtext;text-decoration:none'>mailto:list@fajar.net</span></a>]<o:p></o:p></p><p class=MsoPlainText>> Sent: Friday, April 05, 2013 4:09 PM<o:p></o:p></p><p class=MsoPlainText>> To: David Parks<o:p></o:p></p><p class=MsoPlainText>> Cc: LXC<o:p></o:p></p><p class=MsoPlainText>> Subject: Re: [Lxc-users] eth0 not coming online in LXC environment<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> On Fri, Apr 5, 2013 at 10:33 AM, David Parks <<a href="mailto:davidparks21@yahoo.com"><span style='color:windowtext;text-decoration:none'>davidparks21@yahoo.com</span></a>> wrote:<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> I've got an environment set up now where the host OS has a static IP <o:p></o:p></p><p class=MsoPlainText>> directly connected to the LAN. I'm bridging the containers to have <o:p></o:p></p><p class=MsoPlainText>> their own static LAN IP as well.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> When I start my container eth0 is *not* configured. If I manually add <o:p></o:p></p><p class=MsoPlainText>> `eth0=eth0` in /run/network/ifstate and `service restart networking`, <o:p></o:p></p><p class=MsoPlainText>> it gets configured properly.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> After looking at dmesg output I noticed that there are (unexpected) <o:p></o:p></p><p class=MsoPlainText>> references to em1, which is the host's physical NIC.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> The bridging all works, networking is fine, it's just when I start the <o:p></o:p></p><p class=MsoPlainText>> container, rebooting reproduces the problem, then manually updating <o:p></o:p></p><p class=MsoPlainText>> ifstate and rebooting resolves it.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> I'm not sure how to configure it so it configure eth0 on reboot as I <o:p></o:p></p><p class=MsoPlainText>> would expect.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Well, a description on which distro/version you're running as host and <o:p></o:p></p><p class=MsoPlainText>> container would be nice.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Short version is if you use Ubuntu (preferably quantal/raring for <o:p></o:p></p><p class=MsoPlainText>> newer lxc version, but precise is also fine), then it will just work. <o:p></o:p></p><p class=MsoPlainText>> If you use some other combination (e.g. Centos for container), then be prepared for hickups.<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> I had problems with Centos container, and the "fix" was to force-clean <o:p></o:p></p><p class=MsoPlainText>> /var/run and /var/lock/subsys on container startup:<o:p></o:p></p><p class=MsoPlainText>> <a href="https://github.com/fajarnugraha/lxc/blob/centos-template/templates/lxc"><span style='color:windowtext;text-decoration:none'>https://github.com/fajarnugraha/lxc/blob/centos-template/templates/lxc</span></a><o:p></o:p></p><p class=MsoPlainText>> -cento<o:p></o:p></p><p class=MsoPlainText>> s.in#L90<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> --<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> Fajar<o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> ----------------------------------------------------------------------<o:p></o:p></p><p class=MsoPlainText>> ------<o:p></o:p></p><p class=MsoPlainText>> --<o:p></o:p></p><p class=MsoPlainText>> Minimize network downtime and maximize team effectiveness.<o:p></o:p></p><p class=MsoPlainText>> Reduce network management and security costs.Learn how to hire the <o:p></o:p></p><p class=MsoPlainText>> most talented Cisco Certified professionals. Visit the Employer <o:p></o:p></p><p class=MsoPlainText>> Resources Portal <o:p></o:p></p><p class=MsoPlainText>> <a href="http://www.cisco.com/web/learning/employer_resources/index.html"><span style='color:windowtext;text-decoration:none'>http://www.cisco.com/web/learning/employer_resources/index.html</span></a><o:p></o:p></p><p class=MsoPlainText>> _______________________________________________<o:p></o:p></p><p class=MsoPlainText>> Lxc-users mailing list<o:p></o:p></p><p class=MsoPlainText>> <a href="mailto:Lxc-users@lists.sourceforge.net"><span style='color:windowtext;text-decoration:none'>Lxc-users@lists.sourceforge.net</span></a><o:p></o:p></p><p class=MsoPlainText>> <a href="https://lists.sourceforge.net/lists/listinfo/lxc-users"><span style='color:windowtext;text-decoration:none'>https://lists.sourceforge.net/lists/listinfo/lxc-users</span></a><o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText>> <o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>> ----------------------------------------------------------------------<o:p></o:p></p><p class=MsoPlainText>> -------- Precog is a next-generation analytics platform capable of <o:p></o:p></p><p class=MsoPlainText>> advanced analytics on semi-structured data. The platform includes APIs <o:p></o:p></p><p class=MsoPlainText>> for building apps and a phenomenal toolset for data science. <o:p></o:p></p><p class=MsoPlainText>> Developers can use our toolset for easy data analysis & visualization. <o:p></o:p></p><p class=MsoPlainText>> Get a free account!<o:p></o:p></p><p class=MsoPlainText>> <a href="http://www2.precog.com/precogplatform/slashdotnewsletter"><span style='color:windowtext;text-decoration:none'>http://www2.precog.com/precogplatform/slashdotnewsletter</span></a><o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>> _______________________________________________<o:p></o:p></p><p class=MsoPlainText>> Lxc-users mailing list<o:p></o:p></p><p class=MsoPlainText>> <a href="mailto:Lxc-users@lists.sourceforge.net"><span style='color:windowtext;text-decoration:none'>Lxc-users@lists.sourceforge.net</span></a><o:p></o:p></p><p class=MsoPlainText>> <a href="https://lists.sourceforge.net/lists/listinfo/lxc-users"><span style='color:windowtext;text-decoration:none'>https://lists.sourceforge.net/lists/listinfo/lxc-users</span></a><o:p></o:p></p></div></body></html>