<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:12.0pt;
font-family:"Times New Roman","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.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.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.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=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Interesting discovery. This networking issue only happens on one of 2 servers I now have LXC running on. I tried </span><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>apt-get update</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> and </span><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>apt-get upgrade</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> on the host, no discernible difference. I built them off the same build doc (which I wrote). I went through it again to see if I missed anything, but they seem the same (only thing of note in the server build process would be that lxcbr0 and virbr0 are both disabled, everything else is vanilla 12.10). <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The only other thing that *<b>might</b>* be different that I can think of is that I did a reboot on the 2<sup>nd</sup> server to test it, I might have skipped that step on the 1<sup>st</sup> one which is exhibiting the problem (I can’t reboot it at the moment because one of the containers is busy for a few days of processing).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Both of these instances have the same LXC containers running, I copied them from one to the other and updated the config’s appropriately.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dave<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Fajar A. Nugraha [mailto:list@fajar.net] <br><b>Sent:</b> Friday, April 05, 2013 6:00 PM<br><b>To:</b> David Parks<br><b>Cc:</b> LXC<br><b>Subject:</b> Re: [Lxc-users] eth0 not coming online in LXC environment<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Now that's weird!<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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:<o:p></o:p></p></div><div><p class=MsoNormal>- apt-get update and upgrade, to make sure you have latest version of kernel and lxc<o:p></o:p></p></div><div><p class=MsoNormal>- install new container using ubuntu template: "lxc-create -t ubuntu ...."<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I don't know about ubuntu-cloud template, but the normal ubuntu template works fine for me.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>-- <o:p></o:p></p></div><div><p class=MsoNormal>Fajar<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Fri, Apr 5, 2013 at 4:13 PM, David Parks <<a href="mailto:davidparks21@yahoo.com" target="_blank">davidparks21@yahoo.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>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). </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Fajar A. Nugraha [mailto:<a href="mailto:list@fajar.net" target="_blank">list@fajar.net</a>] <br><b>Sent:</b> Friday, April 05, 2013 4:09 PM<br><b>To:</b> David Parks<br><b>Cc:</b> LXC<br><b>Subject:</b> Re: [Lxc-users] eth0 not coming online in LXC environment</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Fri, Apr 5, 2013 at 10:33 AM, David Parks <<a href="mailto:davidparks21@yahoo.com" target="_blank">davidparks21@yahoo.com</a>> wrote:<o:p></o:p></p><div><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>When I start my container eth0 is *<b>not</b>* configured. If I manually add `eth0=eth0` in /run/network/ifstate and `service restart networking`, it gets configured properly.<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>After looking at dmesg output I noticed that there are (unexpected) references to em1, which is the host’s physical NIC.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I’m not sure how to configure it so it configure eth0 on reboot as I would expect.<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Well, a description on which distro/version you're running as host and container would be nice.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I had problems with Centos container, and the "fix" was to force-clean /var/run and /var/lock/subsys on container startup: <a href="https://github.com/fajarnugraha/lxc/blob/centos-template/templates/lxc-centos.in#L90" target="_blank">https://github.com/fajarnugraha/lxc/blob/centos-template/templates/lxc-centos.in#L90</a><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>-- <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Fajar<o:p></o:p></p></div></div></div></div></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><br>------------------------------------------------------------------------------<br>Minimize network downtime and maximize team effectiveness.<br>Reduce network management and security costs.Learn how to hire<br>the most talented Cisco Certified professionals. Visit the<br>Employer Resources Portal<br><a href="http://www.cisco.com/web/learning/employer_resources/index.html" target="_blank">http://www.cisco.com/web/learning/employer_resources/index.html</a><br>_______________________________________________<br>Lxc-users mailing list<br><a href="mailto:Lxc-users@lists.sourceforge.net">Lxc-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/lxc-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/lxc-users</a><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>