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

Bug 1991804

Summary: Engine using old 2400 maximum score on HA scheduling weight policy
Product: [oVirt] ovirt-engine Reporter: Germano Veit Michel <gveitmic>
Component: BLL.VirtAssignee: Michal Skrivanek <michal.skrivanek>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.4.7CC: ahadas, bugs
Target Milestone: ovirt-4.5.0Flags: pm-rhel: ovirt-4.5?
pm-rhel: devel_ack+
Target Release: 4.5.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.5.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-20 06:33:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Germano Veit Michel 2021-08-10 04:44:27 UTC
Description of problem:

While reviewing the code to update the documentation, I found that the engine is normalizing HA scores based on some very old value range (0, 2400). The patch that introduced this was on 3.4 it seems.

This score range was later extended to (0, 3400), which is today's maximum score if all is well. But the engine will still give best score to all hosts that have > 2400, which does not look right, it should prefer the highest by normalizing based on the current maximum ha score.

https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/HostedEngineHAClusterWeightPolicyUnit.java#L25

Comment 1 Arik 2021-08-12 07:59:46 UTC
Yeah, seems it wasn't updated when the range was extended (https://github.com/oVirt/ovirt-hosted-engine-ha/commit/1bcfe28f195deecefac00901fc26ad15917083e8)
When changing that, we can also add a config value for that (instead of having it hard coded)

Comment 3 Polina 2022-03-27 10:32:52 UTC
verified on ovirt-engine-4.5.0.1-602.3fe8f849c244.6.el8ev.noarch

engine-config -g HostedEngineMaximumHighAvailabilityScore
HostedEngineMaximumHighAvailabilityScore: 3400 version: general


MainThread::INFO::2022-03-27 13:22:17,831::state_machine::172::ovirt_hosted_engine_ha.agent.hosted_engine.HostedEngine::(refresh) Host ocelot06.qa.lab.tlv.redhat.com (id 2): {'host-id': 2, 'host-ts': 355065, 'score': 3400, 'engine-status': {'vm': 'up', 'health': 'good', 'detail': 'Up'}, 'hostname': 'ocelot06.qa.lab.tlv.redhat.com', 'maintenance': False, 'stopped': False, 'crc32': 'c4f53b6a', 'conf_on_shared_storage': True, 'local_conf_timestamp': 355065, 'extra': 'metadata_parse_version=1\nmetadata_feature_version=1\ntimestamp=355065 (Sun Mar 27 13:21:57 2022)\nhost-id=2\nscore=3400\nvm_conf_refresh_time=355065 (Sun Mar 27 13:21:58 2022)\nconf_on_shared_storage=True\nmaintenance=False\nstate=EngineUp\nstopped=False\n', 'alive': True}

--== Host ocelot06.qa.lab.tlv.redhat.com (id: 2) status ==--

Host ID                            : 2
Host timestamp                     : 355416
Score                              : 3400
Engine status                      : {"vm": "up", "health": "good", "detail": "Up"}
Hostname                           : ocelot06.qa.lab.tlv.redhat.com
Local maintenance                  : False
stopped                            : False
crc32                              : 038fc410
conf_on_shared_storage             : True
local_conf_timestamp               : 355416
Status up-to-date                  : True
Extra metadata (valid at timestamp):
	metadata_parse_version=1
	metadata_feature_version=1
	timestamp=355416 (Sun Mar 27 13:27:48 2022)
	host-id=2
	score=3400
	vm_conf_refresh_time=355416 (Sun Mar 27 13:27:48 2022)
	conf_on_shared_storage=True
	maintenance=False
	state=EngineUp
	stopped=False

Comment 4 Sandro Bonazzola 2022-04-20 06:33:59 UTC
This bugzilla is included in oVirt 4.5.0 release, published on April 20th 2022.

Since the problem described in this bug report should be resolved in oVirt 4.5.0 release, it has been closed with a resolution of CURRENT RELEASE.

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