error creating lxdbr0.

Bug #1776958 reported by Scott Moser on 2018-06-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)

Bug Description

$ cat > my.yaml <<EOF
    storage_backend: dir
    mode: new
    name: lxdbr0
    ipv4_netmask: 24
    ipv4_nat: true
    domain: lxd

$ name=c1
$ lxc launch ubuntu-daily:cosmic $name "--config=user.user-data=$(cat my.yaml)"
$ sleep 10
$ lxc exec $name cat /run/cloud-init/result.json
 "v1": {
  "datasource": "DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]",
  "errors": [
   "('lxd', ProcessExecutionError(\"Unexpected error while running command.\\nCommand: ['lxc', 'network', 'create', 'lxdbr0', 'ipv4.address=', 'ipv4.dhcp.ranges=', 'ipv6.address=none', 'dns.domain=lxd', '--force-local']\\nExit code: 1\\nReason: -\\nStdout: \\nStderr: Error: The network already exists\",))"

The integration test case tests/cloud_tests/testcases/modules/
is demonstrates this failure on cosmic. It currently only occurs on
cosmic but will occur anywhere with lxd 3.1.0.

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: cloud-init 18.2-64-gbbcc5e82-0ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-22.24-generic 4.15.17
Uname: Linux 4.15.0-22-generic x86_64
ApportVersion: 2.20.10-0ubuntu3
Architecture: amd64
CloudName: LXD
Date: Thu Jun 14 18:34:15 2018
PackageArchitecture: all
 PATH=(custom, no user)
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
 2018-06-14 18:34:08,417 -[WARNING]: Running module lxd (<module 'cloudinit.config.cc_lxd' from '/usr/lib/python3/dist-packages/cloudinit/config/'>) failed
 cloudinit.util.ProcessExecutionError: Unexpected error while running command.
 Stderr: Error: The network already exists

Related branches

Scott Moser (smoser) wrote :
Changed in cloud-init:
status: New → Confirmed
Changed in cloud-init (Ubuntu):
status: New → Confirmed
Changed in cloud-init:
importance: Undecided → Medium
Changed in cloud-init (Ubuntu):
importance: Undecided → Medium
Scott Moser (smoser) wrote :

The change in behavior of lxd init was filed as an upstream issue at .

Stéphane Graber (stgraber) wrote :

The cloud-init integration would benefit from using the `--preseed` feature of "lxd init" moving forward (on anything that's >= 3.0) as that should let you do pretty much straight yaml passthrough to LXD and avoid having to update the cloud-init schema every time a new feature is added.

Chad Smith (chad.smith) wrote :

An upstream commit landed for this bug.

To view that commit see the following URL:

Changed in cloud-init:
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 18.2-77-g4ce67201-0ubuntu1

cloud-init (18.2-77-g4ce67201-0ubuntu1) cosmic; urgency=medium

  * New upstream snapshot.
    - lxd: Delete default network and detach device if lxd-init created them.
      (LP: #1776958)
    - openstack: avoid unneeded metadata probe on non-openstack platforms
      (LP: #1776701)
    - stages: fix tracebacks if a module stage is undefined or empty
      [Robert Schweikert] (LP: #1770462)
    - Be more safe on string/bytes when writing multipart user-data to disk.
      (LP: #1768600)
    - Fix get_proc_env for pids that have non-utf8 content in environment.
      (LP: #1775371)
    - tests: fix salt_minion integration test on bionic and later
    - tests: provide human-readable integration test summary when --verbose
    - tests: skip chrony integration tests on lxd running artful or older
    - test: add optional --preserve-instance arg to integraiton tests
    - netplan: fix mtu if provided by network config for all rendered types
      (LP: #1774666)
    - tests: remove pip install workarounds for pylxd, take upstream fix.
    - subp: support combine_capture argument.
    - tests: ordered tox dependencies for pylxd install

 -- Chad Smith <email address hidden> Fri, 15 Jun 2018 20:05:07 -0600

Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released

This bug is believed to be fixed in cloud-init in version 18.3. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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