Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1449333

Summary: HA broker checks router pingability by sending a single packet
Product: [oVirt] ovirt-hosted-engine-ha Reporter: Evgheni Dereveanchin <ederevea>
Component: BrokerAssignee: Andrej Krejcir <akrejcir>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: medium Docs Contact:
Priority: high    
Version: 2.1.0.5CC: akrejcir, bugs, gveitmic, lbopf, mgoldboi, mkalinin, stirabos
Target Milestone: ovirt-4.1.3Keywords: Triaged
Target Release: 2.1.4Flags: rule-engine: ovirt-4.1+
rule-engine: exception+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-06 14:02:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1455605    

Description Evgheni Dereveanchin 2017-05-09 16:24:22 UTC
Description of problem:

 Gateway pingability is the score with the highest weight for the HA agent. However, it is computed by sending a single packet to the gateway. This means that loss of a single packet will immediately drop the host score by 1600. If it is running the Hosted Engine, this will cause an engine reboot.

Version-Release number of selected component (if applicable):
ovirt-hosted-engine-ha-2.1.0.5-1.el7.centos.noarch

How reproducible:
Depends on network stability and load

Steps to Reproduce:
1. gateway is not pingable for a few seconds

Actual results:
 Current state EngineUp (score: 1800)
 Host host2 (id 2) score is significantly better than local score, shutting down VM on this host

Expected results:
 Several packets are sent instead of one. Only if all fail, the decision to drop score is made. Alternatively - split score into parts and drop it with each lost packet (i.e send 4 pings, if 1 was lost - only drop 25% of the score)


Additional info:
 Current check is 1 ping with a 10s time out [1], it's better to send at least 3-4 pings with lower timeouts to ensure pingability. 

[1] https://github.com/oVirt/ovirt-hosted-engine-ha/blob/069b625928c18cc7771c3397e35c3a2d48f5ba81/ovirt_hosted_engine_ha/broker/submonitors/ping.py#L44

Comment 1 Martin Sivák 2017-05-10 11:13:58 UTC
I think Evgheni's proposal is reasonable. Lets use 5 pings and make the penalization proportional based on how many packets were lost.

Comment 2 Marina Kalinin 2017-06-22 04:08:16 UTC
My 5 cents here. ICMP traffic is not reliable traffic. Some networks implementation may decide to drop this traffic by definition. In that case 1 or 5 pings would not solve the problem. 

Germano, what are your thoughts on this?

Comment 3 Germano Veit Michel 2017-06-22 04:21:45 UTC
(In reply to Marina from comment #2)
> My 5 cents here. ICMP traffic is not reliable traffic. Some networks
> implementation may decide to drop this traffic by definition. In that case 1
> or 5 pings would not solve the problem. 
> 
> Germano, what are your thoughts on this?

Blocking ICMP altogether is really bad practice, if one does that then I would assume it's not a RHV problem. 

But ICMP echo/reply (ping) are just a small part of ICMP and are sometimes blocked. In most scenarios echo/reply are blocked on routers (L3) and not switches (L2). The gateway is the nexthop from the host so I would assume in most cases we should still be able to ping the next hop (gateway), as it would only go through switches filtering (mostly L2 rules) and then on Router L3 input chain (while filtering is probably at the forwarding plane).

But yes, there will probably be cases that the hosts will never be able to ping the gateway.

Maybe just penalize the score if at least 1 ping succeeded in the past?

Comment 4 Artyom 2017-06-29 14:59:37 UTC
Verified on ovirt-hosted-engine-ha-2.1.4-1.el7ev.noarch
I added iptables rule:
# iptables -I OUTPUT -d $GATEWAY_IP -m limit --limit 1/s --limit-burst 1 -j DROP

agent.log
=========
MainThread::INFO::2017-06-29 17:57:32,883::states::135::ovirt_hosted_engine_ha.agent.hosted_engine.HostedEngine::(score) Penalizing score by 960 due to gateway status

broker.log
==========
Thread-11399::INFO::2017-06-29 17:57:25,541::listener::134::ovirt_hosted_engine_ha.broker.listener.ConnectionHandler::(setup) Connection established
Thread-11399::INFO::2017-06-29 17:57:25,547::listener::186::ovirt_hosted_engine_ha.broker.listener.ConnectionHandler::(handle) Connection closed
Thread-22::WARNING::2017-06-29 17:57:26,732::ping::63::ping.Ping::(action) Failed to ping 10.35.72.254, (1 out of 5)
Thread-10765::WARNING::2017-06-29 17:57:28,231::ping::63::ping.Ping::(action) Failed to ping 10.35.72.254, (2 out of 5)