diff --git a/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb b/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb index 818b83c16c..2eb8a40cce 100644 --- a/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb +++ b/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb @@ -81,4 +81,20 @@ def optionally_disable_rnd command "sed --in-place '/RANDFILE/d' /etc/ssl/openssl.cnf" end end + + def post_install + # ubuntu-desktop comes with NetworkManager. On a cloud instance NetworkManager is unnecessary and causes delay. + # Instruct Netplan to use networkd for better performance + bash 'Instruct Netplan to use networkd' do + code <<-NETPLAN + set -e + cat > /etc/netplan/95-parallelcluster-force-networkd.yaml << 'EOF' +network: + version: 2 + renderer: networkd +EOF + netplan apply + NETPLAN + end unless on_docker? + end end