net: detect unstable network names and trigger a settle if needed
The cloud-init-local.service expects that any network device name
changes have already been completed by the kernel or udev daemon.
In some situations we've found that the renaming of interfaces from
kernel names (eth0, eth1, etc) to their persistent names (eno1, ens3,
enp0s1, etc) may happen after cloud-init-local has started where it
reads values from sysfs about what network devices are present, and
which device to use as a fallback nic.
Subsequently, cloud-init-local would write out network configuration
for a kernel device name which would no longer be present by the time
that networking services start to bring up the devices. The result is
that the instance does not get networking configured. Prior to use of
systemd-networkd, the Ubuntu 'networking.service' unit included a call
to udevadm settle which is why this race is not seen on a Xenial
system.
This change adds the ability to detect if an interface has a stable
name, if if we find one without stable names and stable names have not
been disabled (net.ifnames=0 in /proc/cmdline), then cloud-init will
invoke udevadm settle.
sysconfig: dhcp6 subnet type should not imply dhcpv4
BOOTPROTO=dhcp in sysconfig enables DHCPv4 and we should not do this
implicitly when 'dhcp6' subnet is specified. In case both dhcpv4 and
dhcpv6 are needed users should specify both:
subnets:
- type: dhcp6
- type: dhcp
cloud-init and mdata-get each have their own implementation of the
SmartOS metadata protocol. If cloud-init and other services that call
mdata-get are run concurrently, crosstalk on the serial port can cause
them both to become confused.
This change makes it so that cloud-init uses the same cooperative
locking scheme that's used by mdata-get, thus preventing cross-talk
between mdata-get and cloud-init.
For testing, a VM running on a SmartOS host and pyserial are required.
If the tests are run on a platform other than SmartOS, those that use a
real serial port are skipped. pyserial remains commented in
requirements.txt because most testers will not be running atop SmartOS.