Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.

Bug 1784081

Summary: [RFE] Support for load balancing health checks in OVN
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Timothy Redaelli <tredaelli>
Component: ovn2.11Assignee: Numan Siddique <nusiddiq>
Status: CLOSED ERRATA QA Contact: ying xu <yinxu>
Severity: medium Docs Contact:
Priority: unspecified    
Version: FDP 20.ACC: atragler, cgoncalves, ctrautma, dcbw, jishi, kfida, nusiddiq, ovs-qe, qding, ralongi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovn2.11-2.11.1-24.el7fdn.x86_64 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1703162 Environment:
Last Closed: 2020-01-21 17:02:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Timothy Redaelli 2019-12-16 16:53:40 UTC
+++ This bug was initially created as a clone of Bug #1703162 +++

Health checks are periodic connection attempts to check the healthy status of members. Unhealthy members should be marked as out of service and incoming traffic not forwarded to such members.

Presently, OVN does not support health checks for load balancing members and as so traffic can be forwarded to unhealthy members.

This BZ requests enhancement to OVN to support health checks for members. TCP has probably higher priority over UDP as it's more commonly used in applications.

Comment 2 ying xu 2020-01-08 02:31:10 UTC
verified on version below:

[root@dell-per730-57 basic]# rpm -qa|grep ovn
ovn2.11-host-2.11.1-24.el7fdp.x86_64
kernel-kernel-networking-openvswitch-ovn-common-1.0-6.noarch
ovn2.11-central-2.11.1-24.el7fdp.x86_64
kernel-kernel-networking-openvswitch-ovn-basic-1.0-16.noarch
kernel-kernel-networking-openvswitch-ovn-qos-1.0-1.noarch
ovn2.11-2.11.1-24.el7fdp.x86_64


#add load balance on logical router
                uuid=`ovn-nbctl create load_balancer vips:30.0.0.1="172.16.103.11,172.16.103.12"`
                ovn-nbctl set load_balancer $uuid vips:'"30.0.0.1:8000"'='"172.16.103.11:80,172.16.103.12:80"'
                #create load balance check
                uuid3=`ovn-nbctl --id=@hc create Load_Balancer_Health_Check vip="30.0.0.1\:8000" -- add Load_Balancer $uuid health_check @hc`
                ovn-nbctl set Load_Balancer_Health_Check $uuid3 options:interval=5 options:timeout=20 options:success_count=3 options:failure_count=3
                ovn-nbctl set logical_router r1 load_balancer=$uuid
                ovn-nbctl --wait=sb set load_balancer $uuid ip_port_mappings:172.16.103.12=hv0_vm01_vnet1:172.16.103.1
                ovn-sbctl list service_monitor|grep "status.*\[\]" || ((result += 1))
                rlRun "ovn-sbctl list service_monitor"

[root@dell-per730-57 basic]# ovn-sbctl list service_monitor
_uuid               : af85a476-b867-4a64-b8a9-99fba2c2a8d0
external_ids        : {}
ip                  : "172.16.103.12"
logical_port        : "hv0_vm01_vnet1"
options             : {failure_count="3", interval="5", success_count="3", timeout="20"}
port                : 80
protocol            : tcp
src_ip              : "172.16.103.1"
src_mac             : "de:94:9a:e5:bf:c4"
status              : []



                for ((i=0; i<10; i++))
                do
                    vmsh run_cmd $(vm_name $hv 0) 'curl 30.0.0.1:8000 >> log.txt'
                done
                vmsh run_cmd $(vm_name $hv 0) 'cat log.txt | grep vm1' || ((result += 1))
                vmsh run_cmd $(vm_name $hv 0) 'cat log.txt | grep vm2' || ((result += 1))
                echo "result=$result"
                vmsh run_cmd $(vm_name $hv 0) 'cat log.txt'
                echo "result=$result"

                vmsh run_cmd $(vm_name 1 1) 'ip link set down dev eth1'
                sleep 30
                rlRun "ovn-sbctl list service_monitor"
[root@dell-per730-57 basic]# ovn-sbctl list service_monitor
_uuid               : af85a476-b867-4a64-b8a9-99fba2c2a8d0
external_ids        : {}
ip                  : "172.16.103.12"
logical_port        : "hv0_vm01_vnet1"
options             : {failure_count="3", interval="5", success_count="3", timeout="20"}
port                : 80
protocol            : tcp
src_ip              : "172.16.103.1"
src_mac             : "de:94:9a:e5:bf:c4"
status              : offline

                rlRun "ovn-sbctl list service_monitor|grep \"status.*offline\""
                ovn-sbctl list service_monitor|grep "status.*offline" || ((result += 1))
                vmsh run_cmd $(vm_name 1 1) 'ip link set up dev eth1'
                sleep 30
                rlRun "ovn-sbctl list service_monitor"
                rlRun "ovn-sbctl list service_monitor|grep \"status.*online\""
                ovn-sbctl list service_monitor|grep "status.*online" 
[root@dell-per730-57 basic]# ovn-sbctl list service_monitor
_uuid               : af85a476-b867-4a64-b8a9-99fba2c2a8d0
external_ids        : {}
ip                  : "172.16.103.12"
logical_port        : "hv0_vm01_vnet1"
options             : {failure_count="3", interval="5", success_count="3", timeout="20"}
port                : 80
protocol            : tcp
src_ip              : "172.16.103.1"
src_mac             : "de:94:9a:e5:bf:c4"
status              : online

#change the src_mac
[root@dell-per730-57 basic]# ovn-nbctl set NB_Global . options:svc_monitor_mac="fe:a0:65:a2:01:03"
[root@dell-per730-57 basic]# ovn-sbctl list service_monitor
_uuid               : 89eec067-6f39-4c29-8d7b-3633de6d0bda
external_ids        : {}
ip                  : "172.16.103.11"
logical_port        : "hv0_vm00_vnet1"
options             : {failure_count="3", interval="5", success_count="3", timeout="20"}
port                : 80
protocol            : tcp
src_ip              : "172.16.103.1"
src_mac             : "fe:a0:65:a2:01:03"
status              : online

[root@localhost ~]# tcpdump -i eth1 -e -nn -v 
[60764.285786] device eth1 entered promiscuous mode
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
20:58:44.509627 fe:a0:65:a2:01:03 > 00:de:ad:00:00:01, ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.103.1.44719 > 172.16.103.11.80: Flags [S], cksum 0x37bf (correct), seq 1969041168, win 65160, length 0
20:58:44.509661 00:de:ad:00:00:01 > fe:a0:65:a2:01:03, ethertype IPv4 (0x0800), length 58: (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 44)
    172.16.103.11.80 > 172.16.103.1.44719: Flags [S.], cksum 0x264c (incorrect -> 0x4ef7), seq 1130240533, ack 1969041169, win 29200, options [mss 1460], length 0
20:58:44.510345 fe:a0:65:a2:01:03 > 00:de:ad:00:00:01, ethertype IPv4 (0x0800), length 54: (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto TCP (6), length 40)
    172.16.103.1.44719 > 172.16.103.11.80: Flags [R.], cksum 0xda36 (correct), seq 2, ack 1, win 65160, length 0

Comment 4 errata-xmlrpc 2020-01-21 17:02:46 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-2020:0190