bootstrap fails with LXD provider when not using lxdbr0

Bug #1634744 reported by Andrew McDermott
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Unassigned

Bug Description

My host's network configuration is:

  $ cat /etc/network/interfaces

auto enp5s0
iface enp5s0 inet manual

auto br-enp5s0
iface br-enp5s0 inet static
    address 192.168.1.64/24
    bridge_ports enp5s0
    dns-nameservers 192.168.1.254
    dns-search home
    gateway 192.168.1.254

I ran:

  $ dpkg-reconfigure lxd

and used "br-enp5s0" as the bridge, configured no subnets and disabled IPv6.

  $ juju version
  2.0.0-xenial-amd64

Bootstrapping fails because it tries to connect to the lxd daemon on 192.168.1.254, which you can see from my network setup is my gateway address - there is no lxd listening there.

$ juju bootstrap lxd
Creating Juju controller "lxd-localhost" on lxd/localhost
Looking for packaged Juju agent version 2.0.0 for amd64
To configure your system to better support LXD containers, please see: https://github.com/lxc/lxd/blob/master/doc/production-setup.md
Launching controller instance(s) on lxd/localhost...
 - juju-0f76ff-0 (arch=amd64)
Fetching Juju GUI 2.2.1
Waiting for address
Attempting to connect to 192.168.1.236:22
Logging to /var/log/cloud-init-output.log on the bootstrap machine
Running apt-get update
Running apt-get upgrade
Installing curl, cpu-checker, bridge-utils, cloud-utils, tmux
Fetching Juju agent version 2.0.0 for amd64
Installing Juju machine agent
Attempt 1 to download tools from https://streams.canonical.com/juju/tools/agent/2.0.0/juju-2.0.0-xenial-amd64.tgz...
tools from https://streams.canonical.com/juju/tools/agent/2.0.0/juju-2.0.0-xenial-amd64.tgz downloaded: HTTP 200; time 4.720s; size 22318456 bytes; speed 4728924.000 bytes/s Tools downloaded successfully.
3ce84f9af0e163f5188d1355dc2dc9fb43a1e992d58dc8af874b98bcccc3c0da /var/lib/juju/tools/2.0.0-xenial-amd64/tools.tar.gz
296662810fbd3d4f229d379d8d8be37dfff7fe9711a06be6a8b7dedc80b87907 /var/lib/juju/gui/gui.tar.bz2
2016-10-19 04:41:12 INFO juju.cmd supercommand.go:63 running jujud [2.0.0 gc go1.6.2]
2016-10-19 04:41:12 ERROR cmd supercommand.go:458 new environ: creating LXD client: Get https://192.168.1.254:8443/1.0: Unable to connect to: 192.168.1.254:8443
ERROR failed to bootstrap model: subprocess encountered error code 1

The following code will work for lxdbr0, but not other bridge configurations:

github.com/juju/juju/provider/lxd/environ_raw.go:

func getDefaultGateway(runCommand runCommandFunc) (string, error) {
 out, err := runCommand("ip", "route", "list", "match", "0/0")
 if err != nil {
  return "", errors.Trace(err)
 }
 if !strings.HasPrefix(string(out), "default via") {
  return "", errors.Errorf(`unexpected output from "ip route": %s`, out)
 }
 fields := strings.Fields(string(out))
 return fields[2], nil
}

Revision history for this message
Andrew McDermott (frobware) wrote :
Revision history for this message
Andrew McDermott (frobware) wrote :
Changed in juju:
status: New → Incomplete
Revision history for this message
Gareth Woolridge (moon127) wrote :

I ran into this too this morning, similarly I don't use lxdbr0 but have my lxd host setup to bridge to the local network with containers getting DHCP from my router.

Attached is my e/n/i, juju and lxd versions and full bootstrap output.

Revision history for this message
Andrew McDermott (frobware) wrote :

Adding the transcript I did to workaround this from a conversation on #juju-dev

  http://pastebin.ubuntu.com/23347682/

Changed in juju:
status: Incomplete → Confirmed
Changed in juju:
status: Confirmed → Triaged
importance: Undecided → High
milestone: none → 2.2.0
tags: added: landscape
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.