networkd: add new KeepConfiguration= setting#12511
Conversation
|
@keszybz can you backport this fix for F29+ ( other downstream distribution maintainers should probably do so too ) once this lands, since this is somewhat of an urgent matter for systemd networkd only deployments as well as any network management stack that uses systemd-networkd ( nm/netplan etc ). Downstreams/upstream BZ are probably full of misfiled bugs against keepalive, pacemaker etc related to this underlying issues ( and probably bz.rh will be filled with this against RHEL8 once the bussword summit is over ) @ssahani thanks for looking into this :) |
|
I think this also fixes #11575. |
|
So, the setting is useful not only for HA environment. How about moving
|
|
We can't move |
Of course,
I think the name Anyway, apart from the name of the setting, I like this change. @johannbg You do not need to wait the patch to be backported. Setting |
|
One reason I do not like the name |
|
|
|
@yuwata I'm in midst of setting up test ipv4/ipv6 environment on F30 networkd only setup to test the classic HAProxy + Keepalived setup so I'll try it out but this will need to be backported regardless. @ssahani Presumably in the future HA application stacks would want to have networkd manage the network settings ( and associated sysctl settings ) for them? ( I would not be surprised if there is very little things missing from networkd to do that ) If so it would need to be something that goes nicely with the rest of the [Network] section so something like below instead of HighAvailability= ( I personally think HighAvailability= is quite self explanatory thou ) Redundant= |
Let's just make it generic and something comes in future also we need not add / remove stuff. Other application which have same requirements and we can't just keep on adding them no ? |
|
Redundant=True is probably the most generic terminology which would cover HA amongst other things. |
Well I am not sure @yuwata WDUT?
yeah varlink just went in and we have dbus stuff to do. |
Issue acassen#1170 identified that use_vmac didn't work with systemd-networkd since systemd-networkd was removing IP addresses created by keepalived (and any other application). It was discovered that systemd-networkd did not remove IP addresses from ipvlans. This commit adds support for ipvlans, but to work around the problem, and because it might have other uses. Systemd commit - systemd/systemd#12511 has added configuration options to stop systemd-networkd removing IP addresses added by other applications, but it is not merged yet, and it will be a while before all the distros merge it. Signed-off-by: Quentin Armitage <[email protected]>
|
In case it helps: In my tests (although I'm using netplan), setting network:
version: 2
ethernets:
ens3:
dhcp4: true
critical: trueip a a 1.2.3.4/32 dev eth0
systemctl restart systemd-networkd
ip a |grep 1.2.3.4(Sorry, had no time to reproduce this using plain systemd-networkd.) |
be834e4 to
b0fa0b4
Compare
Yes, this is not tied in any particular way to HA. The name should be generic.
I think so too. Let's go one step futher and use a name that actually describes in plain words what this option does: |
|
yes I would like to work it over the weekend |
b0fa0b4 to
e0e2b82
Compare
e0e2b82 to
0964ef8
Compare
|
Hmm. How about the following?
And then, parser of @ssahani If you are busy recently, then can I update your commit accordingly? BTW, should we split |
0964ef8 to
17fb2d6
Compare
|
@ssahani and @keszybz I've slightly updated @ssahani's commit and added several follow-ups. PTAL. @ssahani Your original commit is saved at https://github.com/yuwata/systemd/tree/ssahani-high-availability-12050-backup. |
4dcd2a5 to
160f237
Compare
|
Thanks for working on this.
It's wrong . As soon as DHCP client stops those addresses are not valid any more. I have already explained it.
Yes .
Yes rest are OK |
|
@ssahani Thank you for the comments.
Theoretically yes. However,
|
Not sure what is theoretically mean. It a BUG.
It a right behaviour. Once networked stops it should drop the DHCP addresses.
How we can ensure that. This is a complete myth.
No It's a practical BUG. |
160f237 to
02bb8ca
Compare
|
Now I understand that 'stopping DHCP client' != 'stopping networkd'. And I guess one reason why our discussion could not converge is I did not understand that. Sorry. @ssahani Could you take a look once more? Now, Of course, the current version still may not answer your request... But, I hope it is better than the previous one. |
|
Yes precisely dynamic addresses are valid when we keep talking with the server. When the communication breaks we can not ensure those addresses are valid. Thanks this is better for sure. LGTM. |
203e7ad to
96738c2
Compare
The option prevents to drop lease address on stop. By setting this, we can safely restart networkd.
Also, KeepConfiguration=dhcp drops static foreign addresses and routes.
|
I think this can go in. It is nice functionality that can be useful in various cases. Nevertheless, I think that we should rework how DHCP addresses are handled. In particular, when restarting, we shouldn't drop any addresses before the restart. All state is serialized, so it's just a question of adjusting to new configuration after restart. I don't want users to set KeepConfiguration= just be able to restart sytemd-networkd painlessly. I'll try to do the rebase now myself and force-push to your branch to redo the CI. |
96738c2 to
1e49885
Compare
|
Rebased. |
This looks pretty legit. networkd drops the foreign addresses upon
restart. This becomes a problem in cases where the additional address
is used as a virtual or floating IP in higih-available environments
(where a master IP is swapped to a different service upon failovers,
e.g. by services like Pacemaker, keepalived and alike, usually using
protocols like Corosync, VRRP or CARP). Those addresses are not handled
by systemd-networkd and are therefore purged upon DHCP renewals or
when an update triggers a restart of systemd-networkd, therefore
potentially resulting in downtimes or at least unecessary failovers.
closes #12050