From: marchettim Date: Fri, 10 Nov 2017 15:02:18 +0000 (+0100) Subject: Merge "Fix MTU of nested LXD containers inside VCA" X-Git-Tag: v3.0.0rc17~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=e309737ac40afbd6bca0736a33383a8b9283758f;hp=38bdcea60afaa661a864febd74db3327a2e7b73c;p=osm%2Fdevops.git Merge "Fix MTU of nested LXD containers inside VCA" --- diff --git a/jenkins/VCA/start_build b/jenkins/VCA/start_build index f2b3c94d..6cc5e301 100755 --- a/jenkins/VCA/start_build +++ b/jenkins/VCA/start_build @@ -60,16 +60,15 @@ DEFAULT_INTERFACE=$(route -n | awk '$1~/^0.0.0.0/ {print $8}') DEFAULT_MTU=$( ip addr show $DEFAULT_INTERFACE | perl -ne 'if (/mtu\s(\d+)/) {print $1;}') INFO "Setting lxdbr0 MTU to $DEFAULT_MTU" -ifconfig lxdbr0 mtu $DEFAULT_MTU -# Make the MTU change persistent between reboots -sed -i '/lxc list/d' /etc/rc.local -sed -i "$ i lxc list > /dev/null" /etc/rc.local -sed -i '/ifconfig lxdbr0 mtu/d' /etc/rc.local -sed -i "$ i ifconfig lxdbr0 mtu $DEFAULT_MTU" /etc/rc.local +# This sets the MTU of lxdbr0 on the host machine without the need to recycle +# the interface or reboot the machine. +ifconfig lxdbr0 mtu $DEFAULT_MTU -# Enable the rc-local service so our changes get executed upon boot -systemctl enable rc-local.service +# Setting the MTU in the default profile will be applied to every lxc container. +# Existing containers will need to be restarted for the new MTU to take effect. +# This will also persist the MTU change for the host's lxdbr0 +lxc profile device set default eth0 mtu $DEFAULT_MTU INFO "Pre-caching Ubuntu:16.04 image (this may take several minutes)..."