cloudinit and DHCP supplied nameservers

Udo Rader udo.rader at
Wed Jun 22 17:08:07 CEST 2022


I've already asked this in the forum, but didn't get an answer, so 
trying here :)

Playing with the cloudinit features, I noticed that even though I 
configured DHCP for my IPv4 configuration, the nameservers would still 
be copied from the PVE node running the cloudinit based VM, if I did not 
manually specify them for the VM.

If I look at the created cloudinit image, it instead contains the copied 
resolver information from the PVE node, for example like this:

version: 1
     - type: physical
       name: eth0
       mac_address: 'xx:xx:xx:xx:xx'
       - type: dhcp4
     - type: nameserver
       - ''
       - ''
       - ''
       - ''

Maybe I am missing something, but this looks weird to me.

I then did a quick hack in /usr/share/perl5/PVE/QemuServer/ 
and commented out the part that creates the nameserver branch in the 
cloudinit image and now the /etc/resolv.conf gets correctly populated 
via DHCP.

Well, is this a feature or a bug :)

Udo Rader, MSc MBA, CTO EDV Systemhaus GmbH
Salurner Straße 15, A-6020 Innsbruck
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck

More information about the pve-devel mailing list