]> git.proxmox.com Git - mirror_ifupdown2.git/commit
add new ifupdown2.conf option ifreload_down_changed to control ifreload
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Sat, 25 Apr 2015 22:33:28 +0000 (15:33 -0700)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Sun, 26 Apr 2015 02:12:16 +0000 (19:12 -0700)
commite308cb8280c9f55121665dbfe15c5d94f775491e
tree4ee383b3f30a2adaaeb2ef02fc843ab1e8d937c8
parent4c773918da3321b64a4423bed15b706710a9dbd9
add new ifupdown2.conf option ifreload_down_changed to control ifreload
ifdown behaviour.

Ticket: CM-5819
Reviewed By: CCR-2846
Testing Done: tested ifreload evo test case

ifreload_down_changed is 0 by default which will make
sure ifreload will not execute down on changed interfaces
but only on deleted interfaces making it non-disruptive.

some notes from CCR:

ifreload was designed to be an optimization for 'service networking
restart' or 'ifdown -a + ifup -a'.
essentially it is a combination of 'ifdown + ifup' with some smarts in
which interfaces it will execute ifdown on.

By default it does the below:
ifdown all interfaces that were deleted from the interfaces file
ifdown all interfaces that were changed from the last time they were
ifup'ed
ifup -a (execute ifup on all interfaces marked auto)

Did not realize people will use ifreload as much as they do today. Also,
they may execute it on a production box when changes are made. ifdown on a production box can be
disruptive because if the ifdown which is part of the ifreload.

To have a non-disruptive option to ifreload, 2.5 added a new option -c
that only executed 'ifup' on all interfaces. Thus reloading all auto +
any other interfaces that were once brought up on the box (essentially
all interfaces present in the saved state file). This by default did not
do anything to the interfaces that got deleted from the file. But had an
ifupdown2.conf toggle to do so.

Looking at the evo use case, they do want to use a single command that
modifies, adds, deletes with
minimum disruption. we can achieve maybe what they want with multiple
commands (But there is also a case of a bug in the build evo is running
which makes it not so easy ).

This patch fixes the bug and also tries to change the default ifreload
behaviour controllable via a variable in ifupdown2.conf.
when ifreload_down_changed=0 in ifupdown2.conf, ifreload will only
ifdown interfaces that were deleted
from the file but not the ones that changed. subsequent ifup as part of
ifreload on the interfaces
that changed will apply the delta. And ifreload_down_changed default
value is '0'.

WIth the patch, ifreload by default will do the below (going back to the
previous default is just a toggle in the ifupdown.conf file):
ifdown all interfaces that were deleted from the interfaces file
ifup -a (execute ifup on all interfaces marked auto)

It sounds like a big change of behaviour for a hotfix release, but
essentially the patch just moves a few things around. And the change in
behaviour is so subtle that it is not very visible.
It just makes it non-disruptive.
(cherry picked from commit 2f7977834d4912a69159d27e54ba201f58a321d8)
config/ifupdown2.conf
ifupdown/ifupdownmain.py
ifupdown/scheduler.py