cloud-init
is absolute cancer. Its code is horrible. It has no documentation at all.
It took me 5 fucking hours to figure out how to properly configure networking on recent
cloud-init
(Ubuntu 16.04 cloud image
) with local datasource.
It's not mentioned anywhere you need to provide dsmode: local
. (but only if you need network-config,
besides that everything is fine; someone below noted that -m
flag does the same thing, good to know) Of course nobody needs documentation for network-config
format
either. (cloudinit/net/__init__.py
is a protip, enjoy the feces dive)
Oh, and by the way - no, it's not possible to provide network-config
to uvt-kvm
without patching shit.
Use -N
flag for cloud-localds for network-config
.
Thank you everyone for your help with this! It definitely pointed me in the right direction. I was chasing my tail with Proxmox VE with a custom version 2 (Netplan using the systemd-networkd renderer) network-config on an Ubuntu 22.04 VM. Everything pointed to cloud-init being the problem, but despite modifying the PVE code to add the
dsmode: local
setting to the meta-data-generating source code, it just did not work. What I learned was cloud-init would tell netplan to render the networkd configuration to/run/systemd/network
but it wouldn't actually start the network. It depended on systemd to do that.I found out my network-config was just bad. I was trying to use
set-name: eth0
without matching on a MAC address. Which strangely wouldn't work on bootup, but would work by runningnetplan apply
manually.If you find your network just isn't coming up, check out what
networkctl
is telling you and see if the interface is managed or not. Check your configuration and the system journal and make suresystemd-networkd
is happy.