yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #65335
[Bug 1692028] Re: duplicate mac address during config-drive configuration with LXD container on openstack
This bug was fixed in the package cloud-init - 0.7.9-153-g16a7302f-
0ubuntu1~16.10.1
---------------
cloud-init (0.7.9-153-g16a7302f-0ubuntu1~16.10.1) yakkety-proposed; urgency=medium
* New upstream snapshot.
- net: fix reading and rendering addresses in cidr format.
[Dimitri John Ledkov] (LP: #1689346, #1684349)
- disk_setup: udev settle before attempting partitioning or fs creation.
(LP: #1692093)
- GCE: Update the attribute used to find instance SSH keys.
[Daniel Watkins] (LP: #1693582)
- nplan: For bonds, allow dashed or underscore names of keys.
[Dimitri John Ledkov] (LP: #1690480)
- tests: python2.6: fix unit tests usage of assertNone and format.
- tests: update docstring on test_configured_list_with_none
- fix tools/ds-identify to not write None twice.
- tox/build: do not package depend on style requirements.
- tests: ntp: Restructure cc_ntp unit tests. [Chad Smith]
- flake8: move the pinned version of flake8 up to 3.3.0
- tests: Apply workaround for snapd bug in test case. [Joshua Powers]
- RHEL/CentOS: Fix dual stack IPv4/IPv6 configuration. [Andreas Karis]
- disk_setup: fix several issues with gpt disk partitions. (LP: #1692087)
- function spelling & docstring update [Joshua Powers]
- tests: Fix unittest bug in ntp tests. [Joshua Powers]
- tox: move pylint target to 1.7.1
- Fix get_interfaces_by_mac for empty macs (LP: #1692028)
- DigitalOcean: remove routes except for the public interface.
[Ben Howard] (LP: #1681531.)
- netplan: pass macaddress, when specified, for vlans
[Dimitri John Ledkov] (LP: #1690388)
- doc: various improvements for the docs on cc_users_groups.
[Felix Dreissig]
- cc_ntp: write template before installing and add service restart
[Ryan Harper] (LP: #1645644)
- tests: fix cloudstack unit tests to avoid accessing
/var/lib/NetworkManager [Lars Kellogg-Stedman]
- tests: fix hardcoded path to mkfs.ext4 [Joshua Powers] (LP: #1691517)
- Actually skip warnings when .skip file is present.
[Chris Brinker] (LP: #1691551)
- netplan: fix netplan render_network_state signature.
[Dimitri John Ledkov] (LP: #1685944)
- Azure: fix reformatting of ephemeral disks on resize to large types.
(LP: #1686514)
- make deb: Add devscripts dependency for make deb.
Cleanup packages/bddeb. [Chad Smith] (LP: #1685935)
- openstack: fix log message copy/paste typo in _get_url_settings
[Lars Kellogg-Stedman]
- unittests: fix unittests run on centos [Joshua Powers]
- Improve detection of snappy to include os-release and kernel cmdline.
(LP: #1689944)
- Add address to config entry generated by _klibc_to_config_entry.
[Julien Castets] (LP: #1691135)
- sysconfig: Raise ValueError when multiple default gateways are present.
[Chad Smith] (LP: #1687485)
- FreeBSD: improvements and fixes for use on Azure
[Hongjiang Zhang] (LP: #1636345)
- Add unit tests for ds-identify, fix Ec2 bug found.
- fs_setup: if cmd is specified, use shell interpretation.
[Paul Meyer] (LP: #1687712)
- doc: document network configuration defaults policy and formats.
[Ryan Harper]
- doc: Fix name of "uri" key in docs for "cc_apt_configure" module
[Felix Dreissig]
- tests: Enable artful in integration tests [Joshua Powers]
-- Scott Moser <smoser@xxxxxxxxxx> Fri, 26 May 2017 16:08:21 -0400
** Changed in: cloud-init (Ubuntu Yakkety)
Status: Fix Committed => Fix Released
** Changed in: cloud-init (Ubuntu Xenial)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1692028
Title:
duplicate mac address during config-drive configuration with LXD
container on openstack
Status in cloud-init:
Fix Committed
Status in cloud-init package in Ubuntu:
Fix Released
Status in cloud-init source package in Xenial:
Fix Released
Status in cloud-init source package in Yakkety:
Fix Released
Status in cloud-init source package in Zesty:
Fix Released
Status in cloud-init source package in Artful:
Fix Released
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/address:00:00:00:00
gretap0/address:00:00:00:00:00:00
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_by_mac()' in the
guest.
$ lxc exec $name -- \
python3 -c 'from cloudinit import net; print(net.get_interfaces_by_mac())'
4.) upgrade instance to proposed cloud-init
$ lxc exec $name -- sh -c '
mirror=http://archive.ubuntu.com/ubuntu
echo deb $mirror $(lsb_release -sc)-proposed main |
tee /etc/apt/sources.list.d/proposed.list
apt-get update -q
apt-get install -qy cloud-init'
$ lxc exec $name -- dpkg-query --show cloud-init
5.) see that get_interfaces_by_mac() no longer stack traces.
$ lxc exec $name -- \
python3 -c 'from cloudinit import net; print(net.get_interfaces_by_mac())'
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://git.launchpad.net/cloud-init/commit/?id=2c0655feb9
=== 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: ++++++++++++++++++++++++++++++++++++++++++++++++++++Net device 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:3eff:fe1d:aaac/64 | . | link | fa:16:3e:1d:aa:ac |
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-00-31-36-3a-33-00-00-00-00-00-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/python3/dist-packages/cloudinit/cmd/main.py", line 647, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 365, in main_init
init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 629, in apply_network_config
netcfg, src = self._find_networking_config()
File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 616, in _find_networking_config
if self.datasource and hasattr(self.datasource, 'network_config'):
File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceConfigDrive.py", line 150, in network_config
self.network_json, known_macs=self.known_macs)
File "/usr/lib/python3/dist-packages/cloudinit/sources/helpers/openstack.py", line 638, in convert_net_json
known_macs = net.get_interfaces_by_mac()
File "/usr/lib/python3/dist-packages/cloudinit/net/__init__.py", line 403, in get_interfaces_by_mac
(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 DataSourceConfigDrive [net,ver=2][source=/config-drive]. Up 6.0 seconds
Related bugs:
* bug 1692545: guests have unexpected network devices gretap0 and gre0
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1692028/+subscriptions
References