<div dir="ltr">Hey Serge,<br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 5, 2015 at 12:29 AM Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com">serge.hallyn@ubuntu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What i described was in lxc (i.e. lxc-start), not lxd (i.e. lxc launch).<br>
<br>
In lxd, if my understanding of how golang handles map range is correct,<br>
then devices coming from a profile should be applied first (in the order<br>
in which profiles were applied), then container-specific ones.<br></blockquote><div><br></div><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">Go's map iteration order (using the range keyword) is random, could that be the source of this problem?</span><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Quoting Janjaap Bos (<a href="mailto:janjaapbos@gmail.com" target="_blank">janjaapbos@gmail.com</a>):<br>
> They are on different bridges. The config only has the additional nic,<br>
> which should be eth1, and usually is.<br>
> The eth0 nic is defined in the default profile, which is referred to in the<br>
> config.<br>
><br>
> I will test further, just to rule out confusion at my side. It is good to<br>
> know that the order should be as in the config. Maybe it is related to<br>
> applying the profile to the config.<br>
><br>
><br>
> 2015-06-04 17:26 GMT+02:00 Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>>:<br>
><br>
> > Quoting Janjaap Bos (<a href="mailto:janjaapbos@gmail.com" target="_blank">janjaapbos@gmail.com</a>):<br>
> > > When using multiple nics in the container, the order sometimes changes<br>
> > > after a restart.<br>
> > > So eth0 becomes eth1, vice versa.<br>
> ><br>
> > That really shouldn't happen.  lxc adds the nics in a specific order<br>
> > (according to the config).  Are eth0 and eth1 on different bridges?<br>
> > Or perhaps I should ask - how do you determine that they've "switched<br>
> > order"?<br>
> ><br>
> > > when using LXD, how is this order determined?<br>
> > > There is no entry for eth0 in the config, since that is a standard lxc<br>
> > > network device.<br>
> > > Only the additional network device is added in the container config:<br>
> > > e.g.<br>
> > ><br>
> > > name: c1<br>
> > > profiles:<br>
> > > - default<br>
> > > config:<br>
> > >   raw.lxc: |<br>
> > >     lxc.mount.entry = /var/lib/lxd/lxc/c1/devices/net/tun dev/net/tun<br>
> > none<br>
> > > bind,create=file 0 0<br>
> > >     lxc.mount.entry = /var/lib/lxd/lxc/c1devices/kvm dev/kvm none<br>
> > > bind,create=file 0 0<br>
> > >     lxc.mount.entry = /var/lib/lxd/lxc/c1/devices/fuse dev/fuse none<br>
> > > bind,create=file 0 0<br>
> > >   volatile.baseImage:<br>
> > > a4066a730e6b3d8021dcc7d0c59f2c37624ffdb60d10f1e09c336e4e1631915c<br>
> > >   volatile.eth0.hwaddr: 00:16:3e:33:3c:c2<br>
> > >   volatile.br0.hwaddr: 00:16:3e:5b:4f:19<br>
> > > devices:<br>
> > >   br0:<br>
> > >     parent: br0<br>
> > >     type: nic<br>
> > > ephemeral: false<br>
> > ><br>
> > ><br>
> > > Both nics have a volatile entry (done by lxc or lxd ?)<br>
> > ><br>
> > > Sometime after a restart the nics have switched order in the container.<br>
> > > This of course messes up the network config in the container.<br>
> > ><br>
> > > How can I make the eth0 and eth1 order stick?<br>
> > ><br>
> > > Thanks for your help!<br>
> > ><br>
> > > -Janjaap<br>
> ><br>
> > > _______________________________________________<br>
> > > lxc-users mailing list<br>
> > > <a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
> > > <a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
> ><br>
> > _______________________________________________<br>
> > lxc-users mailing list<br>
> > <a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
> > <a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
<br>
> _______________________________________________<br>
> lxc-users mailing list<br>
> <a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
> <a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote></div></div>