mirror of
https://github.com/flatcar/scripts.git
synced 2026-02-26 18:11:45 +01:00
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 <jpiotrowski@microsoft.com>
This commit is contained in:
parent
b36fc18724
commit
39f2139d7a
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user