Bug 1477572

Summary: Keepalived 1.3.x ipset functionality seems to be broken
Product: Red Hat Enterprise Linux 7 Reporter: Robert Scheck <redhat-bugzilla>
Component: keepalivedAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Brandon Perkins <bperkins>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: cluster-maint, mlinden, phil.randal, robert.scheck
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: keepalived-1.3.5-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 18:15:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robert Scheck 2017-08-02 12:08:10 UTC
Description of problem:
After updating from RHEL 7.3 to 7.4 (thus keepalived 1.2.x -> 1.3.x), the
logs spew this:

Aug  2 14:00:01 tux1 Keepalived_vrrp[6935]: Unable to load ipset library - libipset.so.3: cannot open shared object file: No such file or directory

Strange. I never configured ipset before. And ipset is also not a dependency
of the keepalived package. Documentation, specifically "man keepalived.conf" 
says:

  # Keepalived may have the option to use ipsets in conjunction with iptables.
  # If so, then the ipset names can be specified, defaults as below.
  # If no names are specified, ipsets will not be used, otherwise any omitted
  # names will be constructed by adding "_if" and/or "6" to previously specified
  # names.
  vrrp_ipset [keepalived [keepalived6 [keepalived_if6]]]

From my understanding, just putting "vrrp_ipset" into global_defs section
should do the trick, right? Logs look then like this:

Aug  2 14:02:36 tux1 Keepalived_vrrp[7145]: Unknown keyword 'vrrp_ipset'
Aug  2 14:02:36 tux1 Keepalived_vrrp[7145]: Unable to load ipset library - libipset.so.3: cannot open shared object file: No such file or directory

Hum? It feels like the keepalived 1.3.x ipset functionality seems to be
broken in general.

And if I install ipset using "yum install ipset", this is still strange
after a restart:

Aug  2 14:04:44 tux1 Keepalived_healthcheckers[7184]: Unknown keyword 'vrrp_ipset'
Aug  2 14:04:44 tux1 Keepalived_vrrp[7185]: Unknown keyword 'vrrp_ipset'
Aug  2 14:04:44 tux1 kernel: ip_set: protocol 6

The configuration option as mentioned in the documentation does still not
exist/work, but now I even have ipset enabled (not desired in this case).

Version-Release number of selected component (if applicable):
keepalived-1.3.5-1.el7.x86_64

How reproducible:
Everytime, see above.

Actual results:
Keepalived yells for missing "libipset.so.3" and "vrrp_ipset" has no effect.

Expected results:
Working options to disable ipset functionality.

Comment 2 Robert Scheck 2017-08-02 13:32:34 UTC
Cross-filed ticket 01903060 on the Red Hat customer portal.

Comment 3 Ryan O'Hara 2017-08-02 14:42:59 UTC
Please install 'ipset-libs' while we determine what dependency is missing from the rpm.

Comment 4 Robert Scheck 2017-08-02 14:48:32 UTC
As already mentioned above, this does not make things better. Installing ipset 
just enables ipset support unconditionally, which I do not want to have enabled 
(according to the docs, "vrrp_ipset" should disable ipset; keepalived itself
is also up and running when having the ipset package not installed - the issue
here is that keepalived does not handle ipset dependency and vrrp_ipset keyword
properly).

Comment 5 Robert Scheck 2017-08-02 14:50:16 UTC
Or simpler said: Even "vrrp_ipset" keyword usage (= disable) according to the
documentation and the missing "libipset.so.3" errors show up in the logs, 
keepalived works - and indeed without ipset support. But this behaviour feels
just broken.

Comment 6 Ryan O'Hara 2017-08-02 15:30:19 UTC
(In reply to Ryan O'Hara from comment #3)
> Please install 'ipset-libs' while we determine what dependency is missing
> from the rpm.

OK, so 'ipset-libs' was pulled in when you installed 'ipset'. We need to fix the spec file to that keepalived has a dependency on 'ipset-libs'.

The other bug here is in the man page. The keyword should be "vrrp_ipsets", not "vrrp_ipset". I reported this upstream this morning and it is already fixed. We will also need to fix the man page in RHEL.

Comment 7 Robert Scheck 2017-08-02 20:15:13 UTC
Thanks! :) But are you sure that disabling using "vrrp_ipsets" works?

global_defs {
  # …
  vrrp_ipsets
}

leads to:

Aug  2 22:12:40 tux1 kernel: Netfilter messages via NETLINK v0.30.
Aug  2 22:12:40 tux1 kernel: ip_set: protocol 6

Why does keepalived load ipset, even I disable it using the setting?

Comment 8 Ryan O'Hara 2017-09-14 15:47:47 UTC
(In reply to Robert Scheck from comment #7)
> Why does keepalived load ipset, even I disable it using the setting?

In my experience, specifying "vrrp_ipsets" in the global_defs will enable ipsets. The upstream documentation is a bit confusing because it says that not specifying a name will disable ipsets, but it also says that the there is a default ipset4 name (keepalived). That is from the keepalived.conf.SYNOPSIS. On the other name, the keepalived.conf man page says otherwise. If you don't want ipsets, I'd just not specify in the config.

Comment 9 Robert Scheck 2017-09-14 15:55:00 UTC
I dislike the difference between experience and documentation here. Let us
please clarify this with upstream if needed and if the documentation is not
correct, let us correct the documentation. As of writing, the documentation
shipped with keepalived (man page) says, just "vrrp_ipsets" should disable
it (from keepalived man page: "If no names are specified, ipsets will not be 
used, otherwise any omitted"), however it obviously loads some ipset related
kernel stuff.

Comment 14 errata-xmlrpc 2018-04-10 18:15:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0972