After some research, I learned that this was because my VMs had 10.0.2.3 listed as the first nameserver in /etc/resolv.conf. I learned that this is injected when a NAT interface is configured because a Bridge interface is not specified. From the documentation for Proxmox qm:
The thing is, I was configuring the VM to use a Bridge Interface in the --net0 flag for qm create. Here are my commands:The NIC you added to the VM can follow one of two different models:
in the default Bridged mode each virtual NIC is backed on the host by a tap device, ( a software loopback device simulating an Ethernet NIC ). This tap device is added to a bridge, by default vmbr0 in Proxmox VE. In this mode, VMs have direct access to the Ethernet LAN on which the host is located.
in the alternative NAT mode, each virtual NIC will only communicate with the Qemu user networking stack, where a built-in router and DHCP server can provide network access. This built-in DHCP will serve addresses in the private 10.0.2.0/24 range. The NAT mode is much slower than the bridged mode, and should only be used for testing. This mode is only available via CLI or the API, but not via the WebUI.
Code: Select all
qm create 170 --cores 2 --memory 4096 --net0 "virtio,bridge=vmbr0" --ipconfig0 "gw=192.168.1.1,ip=192.168.1.170/24" --nameserver 192.168.1.10 --searchdomain "sol.milkyway" --sshkeys /root/.ssh/sol.milkyway.kubernetes.pub
wget https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2c -O /tmp/CentOS7.qcow2c
qm importdisk 170 /tmp/CentOS7.qcow2c Proxmox_lvm-thin
qm set 170 --scsihw virtio-scsi-pci --scsi0 Proxmox_lvm-thin:vm-170-disk-0
qm resize 170 scsi0 50G
qm set 170 --ide2 Proxmox_lvm-thin:cloudinit
qm set 170 --boot c --bootdisk scsi0
qm start 170
Code: Select all
[centos@VM170 ~]$ cat /etc/resolv.conf
; Created by cloud-init on instance boot automatically, do not edit.
;
# Generated by NetworkManager
nameserver 10.0.2.3
nameserver 192.168.1.10
search sol.milkyway
Code: Select all
modprobe nbd max_part=8
qemu-nbd --connect=/dev/nbd0 /tmp/CentOS7.qcow2c
fdisk -l /dev/nbd0
mount /dev/nbd0p1 /mnt/tmp
cat /mnt/tmp/etc/resolv.conf
Code: Select all
# Generated by NetworkManager
nameserver 10.0.2.3
EDIT: If it wasn't clear from my wget command above, this is the source of the qcow2 image: https://cloud.centos.org/centos/7/image ... oud.qcow2c
However, I can confirm it also exists in these images as well:
Code: Select all
CentOS-7-x86_64-GenericCloud.qcow2
CentOS-7-x86_64-GenericCloud-1809.qcow2
CentOS-7-x86_64-GenericCloud-1808.qcow2