Below is the cloud-init network configuration for the VM:
But when the VM boots, there is an additional DNS server being inserted by cloud-init:
The DNS server `192.168.122.1` is being added but is not apart of the configuration and is not functional:
Here are the steps I used to create the cloud-init template (and to reproduce the issue):
I've tested with an Unbuntu Focal image and this appears to be an issue with only the CentOS images (7 and 8), but everything I've read so far has indicated to use the GenericCloud image provided by CentOS.
I'm looking for suggestions on how to address this.
root@proxmox:~# qm cloudinit dump XXX network
version: 1
config:
- type: physical
name: eth0
mac_address: 'ce:f0:98:cb:ad:0f'
subnets:
- type: static
address: '10.x.x.x'
netmask: '255.255.255.0'
gateway: '10.x.x.x'
- type: nameserver
address:
- '10.x.x.x'
search:
- 'example.domain'
But when the VM boots, there is an additional DNS server being inserted by cloud-init:
[user@centos ~]$ cat /etc/resolv.conf
; Created by cloud-init on instance boot automatically, do not edit.
;
# Generated by NetworkManager
nameserver 192.168.122.1
nameserver 10.x.x.x
search example.domain
The DNS server `192.168.122.1` is being added but is not apart of the configuration and is not functional:
[user@centos ~]$ nslookup google.com 192.168.122.1
;; connection timed out; no servers could be reached
Here are the steps I used to create the cloud-init template (and to reproduce the issue):
# wget https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-2003.qcow2 -O /var/lib/vz/images/CentOS-7-x86_64-GenericCloud-2003.qcow2
# qm create XXX --memory 2048 --net0 virtio,bridge=vmbr0
# cd /var/lib/vz/images/
# qm importdisk XXX CentOS-7-x86_64-GenericCloud-2003.qcow2 local
# qm set XXX --scsihw virtio-scsi-pci --scsi0 local:XXX/vm-XXX-disk-0.raw
# qm set XXX --ide2 local:cloudinit
# qm set XXX --boot c --bootdisk scsi0
# qm set XXX --serial0 socket --vga std
# qm template XXX
[clone from the template and configure cloud-init in the GUI]
I've tested with an Unbuntu Focal image and this appears to be an issue with only the CentOS images (7 and 8), but everything I've read so far has indicated to use the GenericCloud image provided by CentOS.
I'm looking for suggestions on how to address this.
- Is there a setting I'm missing?
- Is there a different CentOS cloud-init image I should be using?
- How are other people dealing with this?