duplicate mac address during config-drive configuration with LXD container on openstack
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned | ||
Zesty |
Fix Released
|
Medium
|
Unassigned | ||
Artful |
Fix Released
|
Medium
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
When the 'ip_gre' module is loaded, the kernel creates two network
devices 'gre0' and 'gretap0' that appear in all network namespaces.
(For example, if you create an lxd container, and then load the ip_gre
module from outside the container, the container will see 2 new
network devices).
The hardware address of these devices is 00:00:00:00:00 as seen below.
# ( cd /sys/class/net/ && grep . gre*/address )
gre0/
gretap0/
This "duplicate" mac address caused cloud-init to raise a RuntimeError.
The overall impact is that cloudinit's network rendering code will
not work if the ip_gre module is loaded on the system. That will
happen in some nova-lxd environments, but also anywhere where a user
has loaded that module and is running lxc.
[Test Case]
1.) load a module on your host
sudo modprobe ip_gre
2.) Launch an instance in lxd.
$ rel=xenial
$ name=x1
$ lxc launch ubuntu-daily:$rel $name
3.) see the stack trace by running 'get_interfaces
$ lxc exec $name -- \
python3 -c 'from cloudinit import net; print(net.
4.) upgrade instance to proposed cloud-init
$ lxc exec $name -- sh -c '
mirror=http://
echo deb $mirror $(lsb_release -sc)-proposed main |
tee /etc/apt/
apt-get update -q
apt-get install -qy cloud-init'
$ lxc exec $name -- dpkg-query --show cloud-init
5.) see that get_interfaces_
$ lxc exec $name -- \
python3 -c 'from cloudinit import net; print(net.
A more complete test case is to load an image into nova-lxd with gre
tunneling loaded on the host, but that is much more involved setup.
[Regression Potential]
Regression potential should be pretty low. We are simply ignoring
network interfaces not named 'lo' that have a mac address of '00:00:00:00:00'
[Other Info]
Upstream commit at
https:/
=== End SRU Template ===
Whilst testing the changes for nova-lxd to resolve issues with use of config-drive, I tripped over this issue; specifically the networking on a config-drive configured LXD instance never starts due to a duplicate MAC address on the lo and greptap0 devices.
Cloud-init v. 0.7.9 running 'init' at Fri, 19 May 2017 13:41:00 +0000. Up 2.0 seconds.
ci-info: +++++++
ci-info: +------
ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |
ci-info: +------
ci-info: | gretap0 | False | . | . | . | 00:00:00:00:00:00 |
ci-info: | eth0 | True | . | . | . | fa:16:3e:1d:aa:ac |
ci-info: | eth0 | True | fe80::f816:
ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | . | . |
ci-info: | lo | True | ::1/128 | . | host | . |
ci-info: | gre0 | False | . | . | . | 00-00-00-
ci-info: +------
2017-05-19 13:41:01,017 - util.py[WARNING]: failed stage init
failed run of stage init
-------
Traceback (most recent call last):
File "/usr/lib/
ret = functor(name, args)
File "/usr/lib/
init.
File "/usr/lib/
netcfg, src = self._find_
File "/usr/lib/
if self.datasource and hasattr(
File "/usr/lib/
self.
File "/usr/lib/
known_macs = net.get_
File "/usr/lib/
(name, ret[mac], mac))
RuntimeError: duplicate mac found! both 'gretap0' and 'lo' have mac '00:00:00:00:00:00'
-------
Cloud-init v. 0.7.9 running 'modules:config' at Fri, 19 May 2017 13:41:02 +0000. Up 4.0 seconds.
Cloud-init v. 0.7.9 running 'modules:final' at Fri, 19 May 2017 13:41:04 +0000. Up 6.0 seconds.
Cloud-init v. 0.7.9 finished at Fri, 19 May 2017 13:41:04 +0000. Datasource DataSourceConfi
Related bugs:
* bug 1692545: guests have unexpected network devices gretap0 and gre0
Related branches
- Scott Moser: Approve
- Server Team CI bot: Approve (continuous-integration)
- Ryan Harper: Approve
-
Diff: 107 lines (+22/-8)2 files modifiedcloudinit/net/__init__.py (+3/-0)
tests/unittests/test_net.py (+19/-8)
description: | updated |
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 Zesty): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Artful): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Zesty): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Artful): | |
importance: | Undecided → Medium |
description: | updated |
I'm going to pull this fix to cloud-init, given that we've now filed the upstream nova-lxd bug 1692545 to cover the fact that these gretap devices should not really be there (or at least need a justification).