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

Bug 1658653

Summary: [downstream clone - 4.2.8] Scheduler computes incorrect CPU load of the host where the scheduled VM is running
Product: Red Hat Enterprise Virtualization Manager Reporter: RHV bug bot <rhv-bugzilla-bot>
Component: ovirt-engineAssignee: Andrej Krejcir <akrejcir>
Status: CLOSED NEXTRELEASE QA Contact: Liran Rotenberg <lrotenbe>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bugs, lrotenbe, mavital, mtessun, ratamir, rbarry, Rhev-m-bugs
Target Milestone: ovirt-4.3.0Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.8.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1653752 Environment:
Last Closed: 2019-01-17 13:00:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1653752    
Bug Blocks:    

Description RHV bug bot 2018-12-12 15:47:32 UTC
+++ This bug is an upstream to downstream clone. The original bug is: +++
+++   bug 1653752 +++
======================================================================

Description of problem:
When migrating a VM, the scheduler subtracts the CPU load of the VM from the host where it is currently running. So that the host can appear as if the VM is not running there.

This calculation is incorrect when the cluster does not have option 'count threads as cores' set.

Version-Release number of selected component (if applicable):
4.3 and 4.2

Steps to Reproduce:
1. Unset the 'count threads as cores' option for the cluster.
2. Have 2 hosts (host1, host2) with 2 threads per CPU core.
3. Run 2 VMs (VM1, VM2) on host1. With the same number of cores as the host, but 1 thread per core.
4. Add VM1 and host1 to an affinity group, positive, enforcing.
5. Create 100% CPU load on VM2. (for example by running: python -c 'while True: pass')
6. Enable EvenDistribution balancing on the cluster. Set HighUtilization to 50.
7. Wait to see if the VM2 will be migrated to host2 by the balancing.

Actual results:
VM2 is not migrated. 
Scheduler incorrectly computes the CPU load of host1, so the host is considered the best candidate for migration and the VM does not migrate.

Expected results:
VM2 migrates to host2.

(Originally by Andrej Krejcir)

Comment 1 RHV bug bot 2019-01-09 14:23:07 UTC
WARN: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{'rhevm-4.2.z': '?'}', ]

For more info please contact: rhv-devops: Bug status (ON_QA) wasn't changed but the folowing should be fixed:

[Found non-acked flags: '{'rhevm-4.2.z': '?'}', ]

For more info please contact: rhv-devops

Comment 2 Raz Tamir 2019-01-09 15:30:34 UTC
Martin,

Could you please take care of acking this bug?

Thanks

Comment 3 Liran Rotenberg 2019-01-15 11:35:00 UTC
Tested on: ovirt-engine-4.2.8.2-0.1.el7ev.noarch
Forth to https://bugzilla.redhat.com/show_bug.cgi?id=1653752#c2
Moving back to assign.

Comment 4 Ryan Barry 2019-01-17 13:00:41 UTC
Closing -- leaving tracking in the upstream bug for 4.3