Open ubuntu-server-builder opened 1 year ago
Launchpad user Alberto Contreras(aciba) wrote on 2023-04-10T15:09:13.152518+00:00
Thanks olaszfiu for reporting this.
Global DNS configuration especied in network config v1 under "type: nameserver" is effectively not rendered by the network-manager renderer and it should be.
For reference, these are some related bugs for other renderers:
The solution will probably consist on attaching the DNS to every given interface (like in the referenced bug) as NetworkManager does not have the concept of global DNS config (I think).
This bug was originally filed in Launchpad as LP: #2015494
Launchpad details
Launchpad user olaszfiu(rosario-esposito) wrote on 2023-04-06T15:54:39.018777+00:00
I'm running cloud-init 23.1.1 on a rockylinux 9 virtual machine (running on Proxmox VE) with network-manager renderer.
The cloud-init network-config file is:
version: 1 config:
Inside the VM base image I have, in /etc/cloud/cloud.cfg:
system_info: network: renderers: ['network-manager'] activators: ['network-manager']
When I start the VM, everything works fine and the renderer creates the correct NIC config file: /etc/NetworkManager/system-connections/cloud-init-eth0.nmconnection:
Generated by cloud-init. Changes will be lost.
[connection] id=cloud-init eth0 uuid=1dd9a779-d327-56e1-8454-c65e2556c12c type=ethernet
[user] org.freedesktop.NetworkManager.origin=cloud-init
[ethernet] mac-address=62:04:02:7B:34:A0
[ipv4] method=manual may-fail=false address1=172.18.7.1/23 gateway=172.18.7.254
The problem is that /etc/resolv.conf is not correctly configured with my DNS servers:
cat /etc/resolv.conf
Generated by NetworkManager
search na.infn.it
Digging into /usr/lib/python3.9/site-packages/cloudinit/net/network_manager.py it seems to me that networ-manager renderer only adds DNS servers if specified in NIC configuration (i.e. in a "subnets" section of the yaml network-config file). Those specified under "type: nameserver" get ignored.
Not sure if this is a bug or it's the expected behavior. Could you please clarify ?
Thanks