cloud-init netplan renderer might need to delete baked in configuration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
High
|
Scott Moser | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
Writing netplan configuration during cloud-init's local phase
does not work properly. This is because there is stale configuration
from the default installed files in a Ubuntu core image.
The change to cloud-initn was to clean those up so that it could
invoke netplan apply.
[Test Case]
Unit tests were added that excercise this code, full functional
test would run through ubuntu core. To do this on ubuntu cloud images
we will simulate.
lxc-proposed-
https:/
It publishes an image to lxd with proposed enabled and cloud-init upgraded.
$ release=xenial
$ ref=$release-
$ lxc-proposed-
$ lxc init $ref $name
$ cat > 00-snapd-
# This is the initial network config.
# It can be overwritten by cloud-init or console-conf.
network:
version: 2
ethernets:
all-en:
match:
dhcp4: true
all-eth:
match:
dhcp4: true
EOF
$ echo 'system_info: {network: {renderers: ["netplan"]}}' |
lxc file push -p - $name/etc/
$ lxc file push -p 00-snapd-
# xenial does not have netplan, so trick the renderer search.
$ ( set -x; lxc file pull $name/usr/
echo "" | lxc file push netplan $name/usr/
$ lxc start $name
$ sleep 10
$ lxc exec $name ls /etc/netplan/
ls: cannot access '/etc/netplan/
$ grep removing /var/log/
2017-04-04 14:38:18,303 - netplan.py[DEBUG]: removing known config '/etc/netplan/
lxc
# In yakkety, you can see networkd set up the links with
# In xenial, there is no netplan, so we assume broken networking.
$ lxc exec $name ip a
$ lxc exec $name systemctl status systemd-networkd --no-pager --full
[Regression Potential]
This code could delete a users netplan config incorrectly.
That is protected against the config being *exactly* as shown above,
and also named exactly as above.
=== End SRU Template ===
1. Zesty
2. 0.7.9-68-
3. cloud-init with network configuration rendering to netplan config has exclusive control over networkd configuration
4. On images with existing netplan configuration (UC16 has an /etc/netplan/
These files may collide with network-
cloud-init should employ a 'maybe-delete' like function in the eni renderer to
a) remove /etc/netplan/
b) remove /run/systemd/
c) remove /run/systemd/
Once these are removed, cloud-init netplan renderer may write out netplan config, and invoke netplan generate successfully.
raharper@
/etc/netplan
/etc/netplan/
/run/systemd/
/run/systemd/
/run/systemd/
raharper@
-rw-r--r-- 1 root root 0 Mar 23 21:58 /run/systemd/
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Ryan Harper: Approve
-
Diff: 162 lines (+106/-1)2 files modifiedcloudinit/net/netplan.py (+40/-0)
tests/unittests/test_net.py (+66/-1)
description: | updated |
Changed in cloud-init (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Scott Moser (smoser) |
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
description: | updated |
This bug was fixed in the package cloud-init - 0.7.9-87- gd23543eb- 0ubuntu1
--------------- 87-gd23543eb- 0ubuntu1) zesty; urgency=medium
cloud-init (0.7.9-
* debian/ cloud-init. templates: add Bigstep to list of sources. (LP: #1676460)
* New upstream snapshot.
- net: in netplan renderer delete known image-builtin content.
(LP: #1675576)
- doc: correct grammar in capabilities.rst [David Tagatac]
- ds-identify: fix detecting of maas datasource. (LP: #1677710)
- netplan: remove debugging prints, add debug logging [Ryan Harper]
- ds-identify: do not write None twice to datasource_list.
- support resizing partition and rootfs on system booted without initramfs.
(LP: #1677376) [Steve Langasek]
- apt_configure: run only when needed. (LP: #1675185)
- OpenStack: identify OpenStack by product 'OpenStack Compute'.
(LP: #1675349)
- GCE: Search GCE in ds-identify, consider serial number in check.
(LP: #1674861)
- Add support for setting hashed passwords [Tore S. Lonoy] (LP: #1570325)
-- Scott Moser <email address hidden> Thu, 30 Mar 2017 16:46:43 -0400