From ed9fb2fc1919301b97128ee2c28e6b724a4db3c5 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Thu, 14 Oct 2021 13:12:43 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=AE=20Truncate=20/etc/resolv.conf=20fr?= =?UTF-8?q?om=20kickstart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the kickstart of the cloud image, NetworkManager writes an /etc/resolv.conf that contains `nameserver 192.168.122.1`. This causes boot delays with cloud-init since it does some early boot DNS redirection tests before talking to the cloud's metadata service. On some clouds/architectures, this delay is 15 seconds or more. Truncate the /etc/resolv.conf so it can be replaced properly by NetworkManager and cloud-init on the first boot. Signed-off-by: Major Hayden --- fedora-cloud-base.ks | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fedora-cloud-base.ks b/fedora-cloud-base.ks index e52e201..49a65e7 100644 --- a/fedora-cloud-base.ks +++ b/fedora-cloud-base.ks @@ -139,6 +139,11 @@ btrfs filesystem sync / echo "Cleanup leftover networking configuration" rm -f /etc/NetworkManager/system-connections/*.nmconnection +# Truncate the /etc/resolv.conf left over from NetworkManager during the +# kickstart. This causes delays in boot with cloud-init because the +# 192.168.122.1 DNS server cannot be reached. +truncate -s 0 /etc/resolv.conf + # Clear machine-id on pre generated images truncate -s 0 /etc/machine-id