Bug 1260381

Summary: Incorrect behavior of power saving weight module
Product: [oVirt] ovirt-engine Reporter: Artyom <alukiano>
Component: GeneralAssignee: Yanir Quinn <yquinn>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: medium Docs Contact:
Priority: high    
Version: 3.6.0CC: bugs, dfediuck, gklein, jtokar, lsurette, mavital, mgoldboi, rbalakri, rgolan, Rhev-m-bugs, sbonazzo, srevivo, ykaul, yquinn
Target Milestone: ovirt-4.0.2Keywords: Triaged, ZStream
Target Release: 4.0.2.1Flags: dfediuck: ovirt-4.0.z+
mgoldboi: planning_ack+
rgolan: devel_ack+
mavital: testing_ack+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1349345 (view as bug list) Environment:
Last Closed: 2016-08-12 14:29:58 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: 1349345    

Description Artyom 2015-09-06 09:59:40 UTC
Description of problem:
Power saving weight module not work in proper way for hosts with zero vms.

Version-Release number of selected component (if applicable):
rhevm-backend-3.6.0-0.12.master.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Have two hosts with the same CPU arch(host_1, host_2)
2. Run vm with 1Gb on host_1
3. Change scheduler policy to power_saving with default parameters
4. Start additional vm

Actual results:
Vm start on host_2

Expected results:
Vm start on host_1

Additional info:
Problem that when host have zero vms, engine give to host score MaxSchedulerWeight - 1(999), but hosts with vms can have score bigger than(999) because expression:
"score -= vds.getMaxSchedulingMemory() / 100;" under calcEvenDistributionScore method in EvenDistributionWeightPolicyUnit class, we can have have negative score, and then under score method in PowerSavingWeightPolicyUnit class we run "score -= calcEvenDistributionScore(vds, vm, vdsGroup != null ? vdsGroup.getCountThreadsAsCores() : false);"
we can have have score bigger than MaxSchedulerWeight score.

Comment 2 Roy Golan 2015-12-16 09:55:29 UTC
Possibly a bug. Martin will take a look.

Comment 4 Red Hat Bugzilla Rules Engine 2016-07-03 10:37:19 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 5 Sandro Bonazzola 2016-07-12 10:05:12 UTC
Moving back to POST since this bug has been targeted to 4.0.1 but referenced patches are not included in 4.0.1 branch.
Please check this bug status and eventually re-target to 4.0.2.

Comment 6 Artyom 2016-07-24 15:04:06 UTC
Verified on rhevm-4.0.2-0.1.rc.el7ev.noarch