OK, so I came up with this brief patch against PVE/QemuServer/Cloudinit.pm:
Code:
diff --git a/src/PVE/QemuServer/Cloudinit.pm b/src/PVE/QemuServer/Cloudinit.pm
index c1311da8..b3d2e9e2 100644
--- a/src/PVE/QemuServer/Cloudinit.pm
+++ b/src/PVE/QemuServer/Cloudinit.pm
@@ -564,6 +564,10 @@ sub nocloud_network {
my ($searchdomains, $nameservers) = get_dns_conf($conf);
if ($searchdomains || $nameservers) {
$content .= "${i}- type: nameserver\n";
+ if (defined(my $first_non_lo_iface = (sort { $a lt $b } @ifaces)[0])) {
+ (my $first_iface_idx = $first_non_lo_iface) =~ s/^net//;
+ $content .= "${i} interface: eth${first_iface_idx}\n";
+ }
if (defined($nameservers) && @$nameservers) {
$content .= "${i} address:\n";
$content .= "${i} - '$_'\n" foreach @$nameservers;
... which, after restarting pvedaemon.service on the PVE node, generates YAML on the cidata drive as expected, and structurally equivalent to the Debian-provided cloud-init example as mentioned before - let's take another look at it for good measure:
Code:
network:
version: 1
config:
- type: physical
name: interface0
mac_address: '00:11:22:33:44:55'
subnets:
- type: static
address: 192.168.23.14/27
gateway: 192.168.23.1
- type: nameserver
interface: interface0 # Ties nameserver to interface0 only
address:
- 192.168.23.2
- 8.8.8.8
search:
- exemplary
The equivalent of these settings passed in via PVE's cloud-init support will result in this file and content on cidata ISO fs (I also chose to configure IPv6 via DHCPv6, fwiw):
Code:
$ cat /media/cdrom0/network-config
version: 1
config:
- type: physical
name: eth0
mac_address: 'bc:24:11:11:22:33'
subnets:
- type: static
address: '192.168.23.14/27'
gateway: '192.168.23.1'
- type: dhcp6
- type: nameserver
interface: eth0
address:
- '192.168.23.2'
- '8.8.8.8'
search:
- 'exemplary'
... but when cloud-init on a Debian 13 host is tasked with rendering its "eni" stuff, THIS JUNK is what comes out as soon as an "interface" key with a valid interface value is present in the resulting dict:
Code:
$ cat /etc/network/interfaces.d/50-cloud-init
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.23.13/24
gateway 192.168.23.1
dns {'nameservers': ['8.8.8.8', '192.168.23.3'], 'search': ['exemplary']}
# control-alias eth0
iface eth0 inet6 dhcp
... which, afaiui, suggests a bug in the eni renderer of cloud-init as provided by Debian 13.
My disappointment is immeasurable and my day is ruined.