juju tries to use lxcbr0 when local provider is configured with kvm containers

Bug #1307677 reported by Tycho Andersen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Dimiter Naydenov
1.21
Fix Released
High
Ian Booth

Bug Description

blackbox:~ cat .juju/environments.yaml
default: local

environments:
  local:
    type: local
    container: kvm
blackbox:~ ifconfig
em1 Link encap:Ethernet HWaddr ec:a8:6b:fb:9a:a4
          inet6 addr: fe80::eea8:6bff:fefb:9aa4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:320 (320.0 B) TX bytes:36514 (36.5 KB)
          Interrupt:20 Memory:f7d00000-f7d20000

eth0 Link encap:Ethernet HWaddr a0:ce:c8:00:6f:97
          inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::a2ce:c8ff:fe00:6f97/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:17267 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9478 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:17960815 (17.9 MB) TX bytes:1033998 (1.0 MB)

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:65536 Metric:1
          RX packets:4235 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4235 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1148586 (1.1 MB) TX bytes:1148586 (1.1 MB)

virbr0 Link encap:Ethernet HWaddr 96:07:67:d0:e8:f8
          inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
          UP BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

blackbox:~ juju bootstrap
ERROR cannot find network interface "lxcbr0": net: no such interface
ERROR failure setting config: cannot find address of network-bridge: "lxcbr0": net: no such interface
ERROR cannot find address of network-bridge: "lxcbr0": net: no such interface

I shouldn't need that bridge to use the kvm-based local provider.

Revision history for this message
Tycho Andersen (tycho-s) wrote :

Oh, my juju version is 1.18.1-trusty-amd64.

tags: added: cloud-installer
Curtis Hovey (sinzui)
tags: added: kvm local-provider
Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
milestone: none → 1.19.1
Revision history for this message
John A Meinel (jameinel) wrote :

I believe there is a config setting for what bridge the nodes should be on. I think it is actually specified as "lxc-bridge" which is a little bit weird when you're setting the container mode to KVM, but it should at least work.

Actually, from what I can see:
 DefaultKvmBridge = "virbr0"

I wonder if you accidentally still had it configured?

John A Meinel (jameinel)
Changed in juju-core:
milestone: 1.19.1 → 1.20.0
Revision history for this message
John A Meinel (jameinel) wrote :

I can see this on trunk. Just doing:
juju bootstrap -e localkvm
juju status -e localkvm

gives:
$ juju status -e localkvm --debug
2014-04-24 11:39:06 INFO juju.cmd supercommand.go:296 running juju-1.19.1-trusty-amd64 [gc]
2014-04-24 11:39:06 DEBUG juju.conn api.go:193 no cached API connection settings found
2014-04-24 11:39:06 INFO juju.provider.local environprovider.go:40 opening environment "localkvm"
2014-04-24 11:39:06 DEBUG juju.container.kvm kvm.go:51 kvm-ok output:
INFO: /dev/kvm exists
KVM acceleration can be used

2014-04-24 11:39:06 DEBUG juju.provider.local environ.go:293 found "10.0.3.1" as address for "lxcbr0"
2014-04-24 11:39:06 DEBUG juju.provider.common state.go:74 waiting for DNS name(s) of state server instances [localhost]
2014-04-24 11:39:06 ERROR juju.container.kvm kvm.go:141 failed getting all instances: exit status 1
2014-04-24 11:39:06 DEBUG juju.provider.common state.go:79 error getting state instances: exit status 1
2014-04-24 11:39:06 ERROR juju.cmd supercommand.go:299 Unable to connect to environment "localkvm".
Please check your credentials or use 'juju bootstrap' to create a new environment.

Changed in juju-core:
milestone: 1.20.0 → 1.19.1
summary: - juju complains about missing lxcbr0 with local environment and kvm
- provider
+ juju tries to use lxcbr0 when local provider is configured with kvm
+ containers
Revision history for this message
William Reade (fwereade) wrote :

We have "lxcbr0" set as the default in the local provider config. We should leave it empty, and pick lxcbr0 or virbr0 depending on the container type, in Prepare.

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

Note that if I change my config to:
    localkvm:
        type: local
        container: kvm
        network-bridge: virbr0

I end up with:
$ juju status -e localkvm --debug
2014-04-24 11:42:41 INFO juju.cmd supercommand.go:296 running juju-1.19.1-trusty-amd64 [gc]
2014-04-24 11:42:41 DEBUG juju.conn api.go:193 no cached API connection settings found
2014-04-24 11:42:41 INFO juju.provider.local environprovider.go:40 opening environment "localkvm"
2014-04-24 11:42:41 DEBUG juju.container.kvm kvm.go:51 kvm-ok output:
INFO: /dev/kvm exists
KVM acceleration can be used

2014-04-24 11:42:41 DEBUG juju.provider.local environ.go:293 found "192.168.122.1" as address for "virbr0"
2014-04-24 11:42:41 DEBUG juju.provider.common state.go:74 waiting for DNS name(s) of state server instances [localhost]
2014-04-24 11:42:41 ERROR juju.container.kvm kvm.go:141 failed getting all instances: exit status 1
2014-04-24 11:42:41 DEBUG juju.provider.common state.go:79 error getting state instances: exit status 1
2014-04-24 11:42:41 ERROR juju.cmd supercommand.go:299 Unable to connect to environment "localkvm".
Please check your credentials or use 'juju bootstrap' to create a new environment.

Error details:
exit status 1

I can see jujud running, and I can confirm that 192.168.122.1 is the local address for virbr0. However, this just isn't working.

Note that if I force the server address in the .jenv file the juju client panics when trying to connect.

Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.19.1 → 1.20.0
Changed in juju-core:
milestone: 1.20.0 → next-stable
Curtis Hovey (sinzui)
tags: added: config
Changed in juju-core:
status: Triaged → In Progress
assignee: nobody → Dimiter Naydenov (dimitern)
Revision history for this message
Dimiter Naydenov (dimitern) wrote :

With this change on trunk https://github.com/juju/juju/pull/1078 the local provider will now use "virbr0" when "container: kvm" is specified and no "network-bridge" is given. If "container: lxc" is specified (or none, as the default), "lxcbr0" will be used when no "network-bridge" is specified.

Revision history for this message
Dimiter Naydenov (dimitern) wrote :

The fix can be backported to 1.20 if needed.

Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.21 → 1.20.12
Revision history for this message
Dimiter Naydenov (dimitern) wrote :

The fix has landed on trunk only, I've updated the milestones.

Changed in juju-core:
milestone: 1.20.12 → 1.22
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Revision history for this message
Adam Stokes (adam-stokes) wrote :
Download full text (5.2 KiB)

So the default behavior was changed in 1.21, however, there is no way to override the `network-bridge: lxcbr0` setting now. For the installer this is a breaking change and imo a regression.

My environments.yaml file:

default: local

environments:
  local:
    type: local
    container: kvm
    lxc-clone: true
    authorized-keys-path: ~/.ssh/id_rsa.pub
    default-series: trusty
    admin-secret: pass
    network-bridge: lxcbr0

But what actually happens is:

user: admin
password: pass
environ-uuid: 35f2fdbd-e6e5-45f2-895a-c621b006765f
state-servers:
- localhost:17070
- 192.168.122.1:17070
server-hostnames:
- localhost:17070
- 192.168.122.1:17070
ca-cert: '-----BEGIN CERTIFICATE-----

  MIICWzCCAcagAwIBAgIBADALBgkqhkiG9w0BAQUwQzENMAsGA1UEChMEanVqdTEy

  MDAGA1UEAwwpanVqdS1nZW5lcmF0ZWQgQ0EgZm9yIGVudmlyb25tZW50ICJsb2Nh

  bCIwHhcNMTUwMTIyMjIwNjIwWhcNMjUwMTI5MjIwNjE5WjBDMQ0wCwYDVQQKEwRq

  dWp1MTIwMAYDVQQDDClqdWp1LWdlbmVyYXRlZCBDQSBmb3IgZW52aXJvbm1lbnQg

  ImxvY2FsIjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuf1IP3/77Mq7ooXG

  Qo5RKD88xBNFQ3FjFXxPgyTF70AizzWu0bopu+MzEpTj3441yW5ZuXyshJqATx2h

  m5qNR8vYYV6fW5pXqsV0JaqMuutCm0T1+nf7auk+wGm8VJeBRDJrQae+olLAC748

  u+KIK2cpMNFVND265yPl+wykHTcCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgCkMA8G

  A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKSIgnp7Wssc+hO8TMev187lMcEPMB8G

  A1UdIwQYMBaAFKSIgnp7Wssc+hO8TMev187lMcEPMAsGCSqGSIb3DQEBBQOBgQBo

  /j3rA/seqkRLgczm/mpdiHt47JZ8RNOHtBzF3z+GORJJxYfqUT2b96ZxCB5y8gNA

  VVGVXkTYGjCxRpRNv+iLieB8rMjI86Ehfl/w1S7KlT99W9tXjKKqRs2Nj1sOrqwn

  vEaCN5pHPRN1fQJwV1d0XVbCBQC9tqQAUs9O/Gxdig==

  -----END CERTIFICATE-----

'
bootstrap-config:
  admin-secret: pass
  agent-metadata-url: ""
  agent-version: 1.21.1
  api-port: 17070
  authorized-keys: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSS2RA47mMlT6SjBLfQaSLVMrkjB+lQn4rqG0KWVPl9LzrZZOVaHGsMI2So2vTELG3pP+omih8gJCiP3riwIQxn6aIEWOLyPBBVSzyq1kHItaCAB1SctadBnRSEtTV/lGhGIcuKIabiv/YzB1Q8YQ6ohUz6lGM2LPoiDD3fOxAUeylUPU7Q7R9nPcVHFIfpMLvkj4iWbIy3UpmCD7VJVVA5sfwwkS5VDjlaAgHABsxEkBqWqpiHOtONNbaOWdeKJJ0Qj8qKQulKyl3nz0OEynYQ6M9S1TrmSZW665cQOtIUQJ9oTRQRTNviiQ4D1+EiMq2wBYzvQHrf2I5rSvtgCDN
    juju-client-key

    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCBMeB+u4tCPtZ3Ul0UtvqvNxQvY765+gvqzNwX9V4EhtKtzPgnCFahk+NjMZBnsUZv5MHgyiF56gdB/NyKKJiQmNC/O5FG1GRvnOoFmEiPwinx6pihjbHKY4NMW9H8Rgqhv3Gcct4z++ItPJQvoLZpzVILTQBTevA/KDqgRlsmPFsfRzvSd14oykaOZBWMKYsF5qNQwWnofMp0KcUukWdWY0m/cCKXLIG/ChyDUtSXNFogNv/RZIg6u5i/9C3ShGG/L5nczDri28s3OuGVS79AcHWLKIN/QSuBBI4JdyLeFJzQwezqWFAS//qKPX/WBxHYRKB2FmcA1RgvoRR/Znv
    adam@maas

'
  bootstrap-addresses-delay: 10
  bootstrap-retry-delay: 5
  bootstrap-timeout: 600
  ca-cert: '-----BEGIN CERTIFICATE-----

    MIICWzCCAcagAwIBAgIBADALBgkqhkiG9w0BAQUwQzENMAsGA1UEChMEanVqdTEy

    MDAGA1UEAwwpanVqdS1nZW5lcmF0ZWQgQ0EgZm9yIGVudmlyb25tZW50ICJsb2Nh

    bCIwHhcNMTUwMTIyMjIwNjIwWhcNMjUwMTI5MjIwNjE5WjBDMQ0wCwYDVQQKEwRq

    dWp1MTIwMAYDVQQDDClqdWp1LWdlbmVyYXRlZCBDQSBmb3IgZW52aXJvbm1lbnQg

    ImxvY2FsIjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuf1IP3/77Mq7ooXG

    Qo5RKD88xBNFQ3FjFXxPgyTF70AizzWu0bopu+MzEpTj3441yW5ZuXyshJqATx2h

    m5qNR8vYYV6fW5pXqsV0JaqMuutCm0T1+nf7auk+wGm8VJeBRDJrQae+olLAC748

    u+KIK2cpMNFVND265yPl+wykHTcCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgC...

Read more...

Revision history for this message
Adam Stokes (adam-stokes) wrote :

juju 1.21.1-0ubuntu1~14 on Trusty

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.