From 39f2139d7a1fa7707f9393021a9fd9df273ab9b1 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 18 Apr 2024 15:28:50 +0000 Subject: [PATCH] app-emulation/wa-linux-agent: Disable interface restarting Flatcar prepares /etc/hostname from the initrd through afterburn. After switching root, systemd-networkd fetches a dhcp lease with the correct hostname already. This publishes the hostname to the vnet DNS server as well. When WALinuxAgent starts, it tries to do the same steps: configure the hostname, bounce the link to force dhcp lease renewal. This has caused issues in the past with multi-nic configurations but also with networked services that are trying to use the network (etcd/flanneld). The link bouncing by WALinuxAgent is not necessary because of Flatcars boot design, so return without bouncing the link. Tested that DNS from other VMs in the same vnet works. Signed-off-by: Jeremi Piotrowski --- .../wa-linux-agent/files/0001-flatcar-changes.patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch index 04cccd5034..694ed8b937 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/wa-linux-agent/files/0001-flatcar-changes.patch @@ -172,7 +172,7 @@ new file mode 100644 index 00000000..e31b2923 --- /dev/null +++ b/azurelinuxagent/common/osutil/flatcar.py -@@ -0,0 +1,78 @@ +@@ -0,0 +1,80 @@ +# +# Copyright 2023 Microsoft Corporation +# @@ -240,6 +240,8 @@ index 00000000..e31b2923 + Restart an interface by bouncing the link. systemd-networkd observes + this event, and forces a renew of DHCP. + """ ++ logger.info("not restarting interface {}".format(ifname)) ++ return + retry_limit = retries + 1 + for attempt in range(1, retry_limit): + return_code = shellutil.run("ip link set {0} down && ip link set {0} up".format(ifname))