juju add-machine lxc:0 fails to start lxc vm

Bug #1280461 reported by Christian Bayle
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-core
New
Undecided
Unassigned

Bug Description

Very similar to ​bug #1246556 lxc containers broken with maas
but not the sma reason I think

Using juju 1.17.2

juju add-machine lxc:0
has the following result

machines:
  "0":
    agent-state: started
    agent-version: 1.17.2.1
    dns-name: g-l6.maas.rd.francetelecom.fr
    instance-id: /MAAS/api/1.0/nodes/node-abcf497a-7df9-11e3-912c-001a6411113a/
    series: precise
    containers:
      0/lxc/0:
        agent-state-info: '(error: error executing "lxc-start": command get_init_pid
          failed to receive response)'
        instance-id: pending
        series: precise

After investication I see that
/etc/lxc/auto/juju-machine-0-lxc-0.conf

has
lxc.network.link = br0

instead of
lxc.network.link = lxcbr0

/etc/lxc/default.conf has the right value
lxc.network.link = lxcbr0

as you can see :

root@g-l6:~# lxc-ls --fancy
NAME STATE IPV4 IPV6 AUTOSTART
----------------------------------------------------
juju-machine-0-lxc-0 STOPPED - - YES

root@g-l6:~# lxc-start -n juju-machine-0-lxc-0
lxc-start: failed to attach 'vethMYNOLA' to the bridge 'br0' : No such device
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 'juju-machine-0-lxc-0'

replacing br0 with lxcbr0
let the container start

Revision history for this message
Christian Bayle (bayle-debian) wrote :

Looks like it's also declared as bug #1271144

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

fwiw this is fixed in trunk

Revision history for this message
Christian Bayle (bayle-debian) wrote :

I updated jujud to 1.17.3.1, but still get the same issue

Revision history for this message
John A Meinel (jameinel) wrote :

So, I'd like to get a bit more detail from you about what you expect here. I believe that on MaaS we *are* supposed to be connecting to br0, because that is bridged onto the external network, which allows the LXC container to get a routable IP address from DHCP.
While "lxcbr0" is only routable on the local machine.

If you believe there is a reason to bind to lxcbr0, then this is a bug that we need to sort out.

If you don't, then this is a dupe of bug #1271144, because we just need to be starting/configuring/whatever the br0 network that we expect to be binding to.

Revision history for this message
Christian Bayle (bayle-debian) wrote :

Hi,
 I install either precise or trusty using Maas, so I have the bridge MaaS sets for me :

juju switch maas
juju bootstrap
juju ssh 0
juju add-machine lxc:0
juju ssh 0

ifconfig -a
....
lxcbr0 Link encap:Ethernet HWaddr f2:1f:29:cb:04:cb
          inet adr:10.0.3.1 Bcast:10.0.3.255 Masque:255.255.255.0
          adr inet6: fe80::f01f:29ff:fecb:4cb/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
          TX packets:185855 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0
          Octets reçus:0 (0.0 B) Octets transmis:29065271 (29.0 MB)
...
but

/var/lib/juju/containers/juju-machine-0-lxc-6/lxc.conf
contains
lxc.network.link = br0

the result is
juju status :
...
    containers:
      0/lxc/6:
        agent-state-info: '(error: error executing "lxc-start": command get_cgroup
          failed to receive response)'
        instance-id: pending
        series: trusty
...

I dunno what changed, but 1 or 2 weeks ago it was just working
maybe some recent change in maas that make br0 is not set

Revision history for this message
Christian Bayle (bayle-debian) wrote :

After reading carefully, I agree this is a dupe of bug #1271144

Revision history for this message
Christian Bayle (bayle-debian) wrote :

juju ssh 0
ifup br0
is enough to have lxc vm running again

Revision history for this message
Craym (sebastien-vionlabs) wrote :

Hi, first time to report and help on a bug. Had the same problem with a brand new trusty 14.04 installation.

On the contrary of bug #1271144, the boostrap is fine and lxcbr0 is setup properly. But juju span the machine with the old config using br0, making the container fail to boot.

I found the bug here :
vim /var/lib/lxc/juju-machine-0-lxc-0/config

The config file has a bug in its generation and the following line is wrong :

lxc.network.link = br0

Replace it for :

lxc.network.link = lxcbr0

And the machine will start properly afterward.

Revision history for this message
BlueBlazer (fill) wrote :

Confirmed on a fresh install of 14.04.1

thanks Craym!

"

I found the bug here :
vim /var/lib/lxc/juju-machine-0-lxc-0/config

The config file has a bug in its generation and the following line is wrong :

lxc.network.link = br0

Replace it for :

lxc.network.link = lxcbr0

And the machine will start properly afterward."

Changed all lxc containers to lxcbr0 and confirmed boot.

I was using on a nonlocal node @ machine 2. but same exact results

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

This was marked as a duplicate, but just got a report of the same issue and resolution with 1.20.11 on maas. same s/br0/lxcbr0 fix.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.