<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;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
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.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
.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'>I just ran some more tests. We’ve got 3 servers with LXC on them, and all 3 servers encounter this same problem, <u>when you reboot a container eth0 is down and not visible</u> in </span><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>/run/network/ifstate </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>(and networking isn’t configured). Adding </span><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>eth0=eth0</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> 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.<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 hosts are Ubuntu 12.10 just installed, pretty close to vanilla except for the configuration settings below.<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'>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).<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'>Any ideas on my next troubleshooting steps here? It’s a royal pain to cycle our ~8 containers so I want to address it.<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><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='background:white;border-collapse:collapse'><tr><td valign=top style='border:solid #DDDDDD 1.0pt;padding:5.25pt 7.5pt 5.25pt 7.5pt'><p class=MsoNormal style='line-height:15.0pt'><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'># Disable lxcbr0 as it’s unused.<o:p></o:p></span></p><p class=MsoNormal style='margin-top:7.5pt;line-height:15.0pt'><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>Edit /etc/default/lxc, set USE_LXC_BRIDGE to false:<o:p></o:p></span></p><p class=MsoNormal style='margin-top:7.5pt;line-height:15.0pt'><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'># Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your<br># containers. Set to "false" if you'll use virbr0 or another existing<br># bridge, or mavlan to your host's NIC.<br>USE_LXC_BRIDGE="false"<o:p></o:p></span></p></td></tr><tr><td valign=top style='border:solid #DDDDDD 1.0pt;border-top:none;padding:5.25pt 7.5pt 5.25pt 7.5pt'><p class=MsoNormal style='line-height:15.0pt'><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>Disable virbr0 as it's unused (a duplicate of lxcbr0)<o:p></o:p></span></p><p class=MsoNormal style='margin-top:7.5pt;line-height:15.0pt'><span style='font-size:10.0pt;font-family:"Courier New";color:#333333'>virsh net-destroy default<br>virsh net-undefine default<o:p></o:p></span></p></td></tr></table><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>