Older libvirt (1.x, 2.x, even older 3.x) try to enforce their own MTU
(1500), overriding it back to 1500 after the udev rule finished.
Delay link modification with 1 second and extend its patten to also
include libvirt's own tap interfaces (<network name>-nic).
Change-Id: I3050c11de7f376df02cbf203e9106b61c560683f
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
function do_udev_cfg {
local _conf='/etc/udev/rules.d/99-opnfv-fuel-vnet-mtu.rules'
# http://linuxaleph.blogspot.com/2013/01/how-to-network-jumbo-frames-to-kvm-guest.html
- echo 'SUBSYSTEM=="net", ACTION=="add|change", KERNEL=="vnet*", ATTR{mtu}="9000"' |& sudo tee "${_conf}"
- sudo udevadm control --reload || true
+ echo 'SUBSYSTEM=="net", ACTION=="add|change", KERNEL=="vnet*", RUN+="/bin/sh -c '"'/bin/sleep 1; /sbin/ip link set %k mtu 9000'\"" |& sudo tee "${_conf}"
+ echo 'SUBSYSTEM=="net", ACTION=="add|change", KERNEL=="*-nic", RUN+="/bin/sh -c '"'/bin/sleep 1; /sbin/ip link set %k mtu 9000'\"" |& sudo tee -a "${_conf}"
+ sudo udevadm control --reload
+ sudo udevadm trigger
}
function do_sysctl_cfg {