eni rendering dhcp6 writes aliases fails to bring up dhcp6
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Ryan Harper | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
cloud-init rendered ENI (/etc/network/
"aliases" (eth0:1). That fails in some scenarios to bring up all interfaces
on boot.
Most specifically problematic is dhcp with ipv4 and dhcp with ipv6.
In that case ipv6 dhcp just would not come up on boot.
[Test Case]
There are unit tests to verify that the new network configuration
is written as expected. Additionally, this is now using the same
ENI rendering format that curtin uses, which has good test cases
in its 'vmtest'.
[Regression Potential]
Users who had done:
ifup eth0:1
will no longer be able to do that. However now this will reliably work:
ifup eth0
to bring up all ip addresses on eth0.
=== End SRU Template ===
Currently, a config like this:
| version: 1
| config:
| - 'type': 'physical'
| 'name': 'iface0'
| 'subnets':
| - {'type': 'dhcp4'}
| - {'type': 'dhcp6'}
Will render:
| auto lo
| iface lo inet loopback
|
| auto iface0
| iface iface0 inet dhcp
| post-up ifup iface0:1
|
|
| auto iface0:1
| iface iface0:1 inet6 dhcp
Below is an example test case that shows the output.
Heres the problem:
$ sudo sh -c 'ifdown eth0; ifup eth0'
$ sudo sh -c 'ifdown eth0; ifup eth0'
Killed old client process
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https:/
Listening on LPF/eth0/
Sending on LPF/eth0/
Sending on Socket/fallback
DHCPRELEASE on eth0 to 172.31.16.1 port 67 (xid=0x32b625f1)
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https:/
Listening on LPF/eth0/
Sending on LPF/eth0/
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0xa4d5f301)
DHCPREQUEST of 172.31.29.161 on eth0 to 255.255.255.255 port 67 (xid=0x1f3d5a4)
DHCPOFFER of 172.31.29.161 from 172.31.16.1
DHCPACK of 172.31.29.161 from 172.31.16.1
bound to 172.31.29.161 -- renewal in 1801 seconds.
Failed to bring up eth0:1.
Failed to bring up eth0.
$ sudo ifup -v eth0:1
Parsing file /etc/network/
Parsing file /etc/network/
Configuring interface eth0:1=eth0:1 (inet6)
/bin/run-parts --exit-on-error --verbose /etc/network/
run-parts: executing /etc/network/
run-parts: executing /etc/network/
+ [ inet6 = meta ]
+ IF_BOND_SLAVES=
+ [ ]
+ [ ]
+ [ -z ]
+ exit
run-parts: executing /etc/network/
/sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
/sbin/sysctl -q -e -w net.ipv6.
/bin/ip link set dev eth0:1 up
/lib/ifupdown/
/sbin/dhclient -1 -6 -pf /run/dhclient6.
--- a/tests/
+++ b/tests/
@@ -813,6 +813,27 @@ class TestEniRoundTri
+ def test_dhcp4_
+ conf = yaml.load(
+ version: 1
+ config:
+ - 'type': 'physical'
+ 'name': 'iface0'
+ 'subnets':
+ - {'type': 'dhcp4'}
+ - {'type': 'dhcp6'}
+ """))
+
+ #conf = [
+ # {'type': 'physical', 'name': 'iface0',
+ # 'subnets': [
+ # {'type': 'dhcp4'},
+ # {'type': 'dhcp6'},
+ # ]},
+ #]
+ files = self._render_
+ raise Exception(
+
Related branches
- cloud-init Commiters: Pending requested
-
Diff: 161 lines (+53/-26)2 files modifiedcloudinit/net/eni.py (+19/-14)
tests/unittests/test_net.py (+34/-12)
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in cloud-init: | |
assignee: | nobody → Ryan Harper (raharper) |
status: | Confirmed → In Progress |
Changed in cloud-init: | |
status: | In Progress → Fix Committed |
Changed in cloud-init (Ubuntu): | |
status: | New → Fix Committed |
status: | Fix Committed → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Incomplete |
Changed in cloud-init (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
status: | Incomplete → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
description: | updated |
This bug was fixed in the package cloud-init - 0.7.9-19- ge987092- 0ubuntu1
--------------- 19-ge987092- 0ubuntu1) zesty; urgency=medium
cloud-init (0.7.9-
* New upstream snapshot.
- manual_cache_clean: When manually cleaning touch a file in instance dir.
- Add tools/ds-identify to identify datasources available.
- Fix small typo and change iso-filename for consistency [Robin Naundorf]
- Fix eni rendering of multiple IPs per interface
[Ryan Harper] (LP: #1657940)
- tools/mock-meta: support python2 or python3 and ipv6 in both.
- tests: remove executable bit on test_net, so it runs, and fix it.
- tests: No longer monkey patch httpretty for python 3.4.2
- Add 3 ecdsa-sha2-nistp* ssh key types now that they are standardized
[Lars Kellogg-Stedman] (LP: #1658174)
- reset httppretty for each test [Lars Kellogg-Stedman] (LP: #1658200)
- build: fix running Make on a branch with tags other than master
- EC2: Do not cache security credentials on disk
[Andrew Jorgensen] (LP: #1638312)
- doc: Fix typos and clarify some aspects of the part-handler
[Erik M. Bray]
- doc: add some documentation on OpenStack datasource.
- OpenStack: Use timeout and retries from config in get_data.
[Lars Kellogg-Stedman] (LP: #1657130)
- Fixed Misc issues related to VMware customization. [Sankar Tanguturi]
- Fix minor docs typo: perserve > preserve [Jeremy Bicha]
- Use dnf instead of yum when available [Lars Kellogg-Stedman]
(LP: #1647118)
- validate-yaml: use python rather than explicitly python3
- Get early logging logged, including failures of cmdline url.
-- Scott Moser <email address hidden> Fri, 03 Feb 2017 21:54:39 -0500