support cloud-init networking with snappy

Bug #1563296 reported by Oliver Grawert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Undecided
Unassigned
cloud-init (Ubuntu)
Fix Released
Medium
Unassigned
livecd-rootfs (Ubuntu)
Fix Released
High
Oliver Grawert

Bug Description

snappy configures /etc/network/interfaces.d/ by default on first boot based on snappy config settings of the ubuntu-core snap

with version 0.7.7~bzr1189-0ubuntu1 cloud-init now starts to also create a file called 50-cloud-init.cfg with differing options to teh snappy default, this breaks ifup on boot and leaves snappy systems completely without network after upgrade.

ubuntu@localhost:~$ ls -l /etc/network/interfaces.d/
total 8
-rw-r--r-- 1 root root 64 Mar 28 09:23 50-cloud-init.cfg
-rw-r--r-- 1 root root 40 Mar 28 09:19 eth0

ubuntu@localhost:~$ cat /etc/network/interfaces.d/50-cloud-init.cfg
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

ubuntu@localhost:~$ cat /etc/network/interfaces.d/eth0
allow-hotplug eth0
iface eth0 inet dhcp

Revision history for this message
Scott Moser (smoser) wrote :

Hmm.
You can disable cloud-init writing network config by putting config in /etc/cloud/cloud.cfg.d/ that says
  network:
    config: disabled

However, that will entirely disable cloud init writing networking information that the data source provided it with.

Currently that is openstack config drive or NoCloud.
But in the future it will be other sources. Basically, the cloud can provide the intended networking to the instance, and the instance should apply it.

2 options I can think of are
 1 adding function for cloud-init to not write 'fallback' networking config but still write carapace provided config
2 having cloud init read and render the snappy provided config

Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Scott Moser (smoser) wrote :

https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1563296

The short term fix is to disable cloud-init's networking code by
writing a file /etc/cloud/cloud.cfg.d/99-snappy-disable-network-config.cfg
with:
| network:
| config: "disabled"

The file is yaml text.

This unfortunately, will have two shortcomings:
 a.) ConfigDrive and other cases where the datasource provides network config will not have that networking rendered on snappy.
 b.) cloud-init has slightly smarter "fallback" config than snappy (to my limited knowledge).
if cloud-init does not find networking configuration from a source, then it defines a fallback as roughly equivalent to "dhcp on eth0" , but the 'eth0' name is chosen by finding an existing network device and filtering out those that are not connected.

Later we will have 2 options to re-enable this
1.) snappy could delegate writing of network config to cloud-init
2.) cloud-init could feed network config it found to snappy and let snappy write the config.

'2' could be accomplished via snappy REST interface or shell via:
   http://paste.ubuntu.com/15559735/

Having this happen via 'fallback' (and thus all the time) might mean that
cloud-init would overwrite what the gadget snap provided. So maybe for
fallback case, cloud-init would want to first query if there was gadget
provided config, and if not then provide the fallback.

Oliver Grawert (ogra)
Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Oliver Grawert (ogra)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.395

---------------
livecd-rootfs (2.395) xenial; urgency=medium

  * create /etc/cloud/cloud.cfg.d/99-snappy-disable-network-config.cfg on
    snappy so we do not end up with broken network config after cloud-init
    ran (LP: #1563296).

 -- Oliver Grawert <email address hidden> Fri, 01 Apr 2016 16:31:50 +0200

Changed in livecd-rootfs (Ubuntu):
status: Confirmed → Fix Released
Scott Moser (smoser)
summary: - cloud-init 0.7.7~bzr1189-0ubuntu1 adds duplicated network config in
- /etc/network/interfaces.d/ in snappy leaving the boot completely
- network-less
+ support cloud-init networking with snappy
Changed in cloud-init (Ubuntu):
importance: High → Medium
Michael Vogt (mvo)
Changed in snappy:
status: New → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Scott, that should be fix released in cloud-init as well right?

Scott Moser (smoser)
Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released
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.