Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loss of VIP's when systemd-networkd is restarted #1385

Closed
matthewbassett opened this issue Sep 12, 2019 · 6 comments
Closed

Loss of VIP's when systemd-networkd is restarted #1385

matthewbassett opened this issue Sep 12, 2019 · 6 comments

Comments

@matthewbassett
Copy link

Describe the bug
Configured virtual IP gets lost during system updates and other system events that trigger a systemd-networkd restart. All things configured by Keepalived on the interface are lost.

To Reproduce
Any steps necessary to reproduce the behaviour: sudo systemctl restart systemd-networkd

Expected behavior
In my research it looks like as of 2.0.0 and later Keepalived should check interface state change immediately rather than waiting for interval to trigger check. Either this is not happening, or I am missing something in my config.

Keepalived version
Output of keepalived -v
Keepalived v2.0.18 (07/26,2019)

Copyright(C) 2001-2019 Alexandre Cassen, acassen@gmail.com

Built with kernel headers for Linux 4.15.18
Running on Linux 4.15.0-62-generic #69-Ubuntu SMP Wed Sep 4 20:55:53 UTC 2019

configure options:

Config options: LVS VRRP VRRP_AUTH OLD_CHKSUM_COMPAT FIB_ROUTING

System options: PIPE2 SIGNALFD INOTIFY_INIT1 VSYSLOG EPOLL_CREATE1 IPV4_DEVCONF IPV6_ADVANCED_API RTA_ENCAP RTA_EXPIRES RTA_NEWDST RTA_PREF FRA_SUPPRESS_PREFIXLEN FRA_SUPPRESS_IFGRO
UP FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK RTEXT_FILTER_SKIP_STATS FRA_L3MDEV FRA_UID_RANGE RTAX_FASTOPEN_NO_COOKIE RTA_VIA FRA_OIFNAME RTA_TTL_PROPAGATE IFA_FLAGS IP_MULTICAST_ALL LWT
UNNEL_ENCAP_MPLS LWTUNNEL_ENCAP_ILA NET_LINUX_IF_H_COLLISION LIBIPTC_LINUX_NET_IF_H_COLLISION IPVS_DEST_ATTR_ADDR_FAMILY IPVS_SYNCD_ATTRIBUTES IPVS_64BIT_STATS VRRP_VMAC VRRP_IPVLAN
IFLA_LINK_NETNSID CN_PROC SOCK_NONBLOCK SOCK_CLOEXEC O_PATH GLOB_BRACE INET6_ADDR_GEN_MODE VRF SO_MARK SCHED_RT SCHED_RESET_ON_FORK

Distro (please complete the following information):

  • Name: Ubuntu
  • Version: Ubuntu 18.04 bionic
  • Architecture: x86_64 Linux 4.15.0-62-generic

Details of any containerisation or hosted service (e.g. AWS)
Run in a Virtual Machine on Hyper-V

Configuration file:
! Configuration File for keepalived

global_defs {
notification_email {
XXXXXXXXXXXXXX
XXXXXXXXXXXXXX
}
notification_email_from XXXXXXXXXXXX
smtp_server localhost
smtp_connect_timeout 30
enable_script_security
}

vrrp_script haproxy {
script "/usr/bin/pgrep haproxy"
interval 2
timeout 1
}

vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 101
priority 255
advert_int 1
authentication {
auth_type XXXX
auth_pass XXXX
}

virtual_ipaddress {
    10.X.X.X
}

track_script {
    haproxy
}

}

Notify and track scripts
track script is one line and in config above

System Log entries
N/A from keepalived's perspective nothing happened.

Did keepalived coredump?
N/A

Additional context
I am working on a tracking script to check for the VIP and transition to FAULT then restart keepalived to recreate IP's, but I don't think this is ideal. I have checked in many different places for answers to this question, but most just say that the problem has already been fixed as of 2.0.0.0+ Thanks for all your awesome work on a solid codebase (: And my apologies if I'm overlooking something I should have done!

@pqarmitage
Copy link
Collaborator

This is a systend-networkd issue.

systemd-networkd should not interfere with network configuration set by other processes, but it assumes it has complete control over network interfaces. See also issue #1170 for systemd-networkd interfering with network configuration set up by other processes. Issue #1268 also relates to configuration established by keepalived being interfered with by other processes.

I don't know if there is a way of configuring systemd-networkd not to interfere with configuration set by other processes. If not, then I think you need to report a but against systemd-networkd and probably switch to another network manager.

@matthewbassett
Copy link
Author

matthewbassett commented Sep 14, 2019 via email

@matthewbassett
Copy link
Author

matthewbassett commented Sep 14, 2019 via email

@pqarmitage
Copy link
Collaborator

For future reference, and anyone else who is having a similar problem, the response to the systemd issue was:

Please use the following in your .network file:

* v242 or earlier (even if you do not use DHCP client in `networkd`)
[DHCP]
CriticalConnection=yes
* v243 or newer
[Network]
KeepConfiguration=yes

However, this did not appear to work for @matthewbassett

@wkoot
Copy link

wkoot commented Oct 15, 2021

Possibly related to https://access.redhat.com/solutions/3541681 ?

@ceesios
Copy link

ceesios commented Mar 8, 2023

I know this issue is closed. However is someone stumbles upon this issue wile using netplan, adding critical: true to your interface config solves this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants