Skip to content

Commit e81104a

Browse files
Instruct NetPlan to use systemd-networkd
systemd-networkd is used by default with Ubuntu Server. Installing ubuntu-desktop (as part of DCV installation) installs NetworkManager. NetworkManager is more complex (with WiFi capabilities) and causes confusion to systemd-networkd. When systemd-networkd is confused, it delays the boot by 2 minutes. This commit instructs NetPlan to use systemd-networkd to manage network interfaces. The code is added at the end of DCV installation because the mitigation is strictly related to the installation of ubuntu-desktop. Always using systemd-networkd also improves consistency between how ParallelCluster handles single-nic instances vs multi-nic instances. With multi-nic instances ParallelCluster has been instructing netplan to use systemd-networkd ([code](https://github.com/aws/aws-parallelcluster-cookbook/blob/develop/cookbooks/aws-parallelcluster-environment/files/ubuntu/network_interfaces/configure_nw_interface.sh#L62)) # Technical details: ## Output of `networkctl list` ### Prior to this commit Base Ubuntu: ``` IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 ens5 ether routable configured 2 links listed. ``` Ubuntu with ubuntu-desktop ``` IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 ens5 ether routable unmanaged 2 links listed. ``` systemd-networkd got confused because it saw no network interface was setup (because NetworkManager took over control of all network interfaces) and waited until 2 minutes timeout at the beginning of system boot: ``` $ journalctl -b | grep -i &quot;ipv6\|timeout\|waiting&quot; ... Sep 18 14:51:23 systemd-networkd-wait-online[1602]: Timeout occurred while waiting for network connectivity. ... Sep 18 14:53:31 systemd-networkd-wait-online[1891]: Timeout occurred while waiting for network connectivity. ... ``` ### After this commit Ubuntu with ubuntu-desktop has the same output as Base Ubuntu and the delay is gone Signed-off-by: Hanwen <hanwenli@amazon.com>
1 parent fb95f2c commit e81104a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,20 @@ def optionally_disable_rnd
8181
command "sed --in-place '/RANDFILE/d' /etc/ssl/openssl.cnf"
8282
end
8383
end
84+
85+
def post_install
86+
# ubuntu-desktop comes with NetworkManager. On a cloud instance NetworkManager is unnecessary and causes delay.
87+
# Instruct Netplan to use networkd for better performance
88+
bash 'Instruct Netplan to use networkd' do
89+
code <<-NETPLAN
90+
set -e
91+
cat > /etc/netplan/95-parallelcluster-force-networkd.yaml << 'EOF'
92+
network:
93+
version: 2
94+
renderer: networkd
95+
EOF
96+
netplan apply
97+
NETPLAN
98+
end unless on_docker?
99+
end
84100
end

0 commit comments

Comments
 (0)