Hi,
i try to get the (network) configuration run with cloud-init.
I am using the x/x/cloud images from the official images server like:
centos/6/cloud
centos/7/cloud
gentoo/cloud
ubuntu/16.04/cloud
ubuntu/18.04/cloud
[…]
I am setting the cloud-init configs like this:
lxc config set CONTAINER user.network-config - < CONTAINER.network-config.yaml
lxc config set CONTAINER user.user-data - < CONTAINER.config.yaml
All user-data cloud-init config directives are processed on all images.
So far, so fine.
Now comes the problem:
Only with the images of
centos 7 and Ubuntu 18.04
the network directives are processed correctly and work as expected.
On all other images, the files are put in place at /var/lib/cloud/seed/… but cloud init does not like the config:
Error message:
Unable to render networking. Network config is likely broken: No available network renderers found. Searched through list: ['eni', 'sysconfig', 'netplan']
So the identical cloud-init network configuration works with centos 7 and ubuntu 18.04, but with the rest its not working.
I have to assume that the cloud-init configuration is fine and correct.
But i wonder if it can be true, that all cloud images on the official lxd server are simply not working correctly, except centos 7 and ubuntu 18.04.
Could someone please tell me how to fix this ?
The user.network-config looks like this:
user.network-config: |
#cloud-config
version: 2
ethernets:
eth0:
addresses: [1.2.3.4/24]
gateway4: 1.2.3.1
nameservers:
addresses: [1.2.3.10]
Of course the formatting is correct, i just dont know how to reproduce this correctly here in this forum.
The config is definitly working fine with centos 7 and ubuntu 18.04 image from the official images server.
Thank you very much for your help and attention.
Greetings
Oliver
Update1: After some (hours) of debugging:
The debian/ubuntu based images have a network config ( /etc/network/interfaces ) file with
auto eth0
iface eth0 inet dhcp
and without any
source /etc/network/interfaces.d/*.cfg
So there is a cloud-init network configfile in /etc/network/interfaces.d/50-cloud-init.cfg but its simply not imported.
After adding source /etc/network/interfaces.d/*.cfg things start to work ( even the DNS config is not correctly taken over ).
The intresting thing is:
Already in 2014 there was a Bugreport about this:
https://bugs.launchpad.net/cloud-images/+bug/1262951
So eighter has never been fixed, or reintroduced.
This flaw seems to go for the debian9+10 and ubuntu 16.04 cloud images. I guess similar will go for the other’s too.
Who has to be informed about this ? This cloud images have been introduced recently. It seems there is some additional work needed to make them work when people try to use the network config with cloud-init
Update2: Ok ok, i am giving up on this. I was trying now to fix the 16.04 cloud image but there the dns resolution does not work too. Resolvconf does not work, just like systemd-resolved does not do its job properly. I guess its more time saving to build up own images from scratch instead of fixing this images.
Update3: Ok, seems i am not ready to give up
Fedora30 does not even create something similar to
/etc/network/interfaces.d/50-cloud-init.cfg but an ens3 dhcp config file.
Its writing into the cloud-init.log:
2019-09-07 23:32:48,185 - stages.py[DEBUG]: applying net config names for {‘version’: 2, ‘ethernets’: {‘eth0’: {‘addresses’: [‘1.2.3.4/24’], ‘gateway4’: ‘1.2.3.1’,‘nameservers’: {‘addresses’: [‘1.2.3.10’]}}}}
2019-09-07 23:32:48,186 - stages.py[DEBUG]: Using distro class <class ‘cloudinit.distros.fedora.Distro’>
2019-09-07 23:32:48,187 - init.py[DEBUG]: no interfaces to rename
2019-09-07 23:32:48,187 - stages.py[INFO]: Applying network configuration from ds bringup=True: {‘version’: 2, ‘ethernets’: {‘eth0’: {‘addresses’: [‘1.2.3.4/24’], ‘gateway4’: ‘1.2.3.1’,‘nameservers’: {‘addresses’: [‘1.2.3.10’]}}}}
2019-09-07 23:32:48,187 - stages.py[ERROR]: Unable to render networking. Network config is likely broken: No available network renderers found. Searched through list: [‘eni’, ‘sysconfig’, ‘netplan’]
/var/lib/cloud/seed/nocloud-net/ is present and correctly populated.
What/where/how ever i search for this unable to render networking problem, its mostly connected to malfuncture cloud-init implementations of the distributions.
By the way: It does not matter if i use network v1 or v2.
So clear warning, dont use the cloud images from the offical image server!
Greetings
Oliver