Bug 1484023

Summary: Cpu Share doesn't work as expected
Product: [oVirt] ovirt-engine Reporter: Shira Maximov <mshira>
Component: BLL.VirtAssignee: Arik <ahadas>
Status: CLOSED CURRENTRELEASE QA Contact: Shira Maximov <mshira>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: bugs, michal.skrivanek, mshira
Target Milestone: ovirt-4.2.0Keywords: Automation, Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:05:27 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:
Bug Depends On:    
Bug Blocks: 1482484    
Attachments:
Description Flags
vdsm log none

Description Shira Maximov 2017-08-22 13:20:20 UTC
Created attachment 1316650 [details]
vdsm log

Description of problem:
Cpu Share doesn't work as expected, 

Version-Release number of selected component (if applicable):
Software version:4.2.0-0.0.master.20170811144920.gita423008.el7.centos


How reproducible:
100%

Steps to Reproduce:
1. Create 4 vms on the host, pin all vms to the same core (0#0)
2. Set the VMs cpu shares to low,low, medium and high  
3. Run 'dd if=/dev/zero of=/dev/null &' on each VM to load the cpu
4. Check the cpu usage of each VM in the host (with top)



Actual results:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                          
 1795 qemu      20   0 1677276 461624  13208 S  25.3 11.9   7:40.94 qemu-kvm                                                                         
 1582 qemu      20   0 1668056 461044  13208 S  25.0 11.9   7:58.45 qemu-kvm                                                                         
 1924 qemu      20   0 1666860 459632  13204 S  25.0 11.8   7:36.02 qemu-kvm                                                                         
 1689 qemu      20   0 1697576 461992  13208 S  24.7 11.9   7:47.11 qemu-kvm      

Expected results:
The VM should take 13,13,25,50 ~ CPU usage.

Additional info:

Comment 1 Yaniv Kaul 2017-08-23 08:08:05 UTC
Shira, it's quite clear the shares are missing from the libvirt XML, no?
<cputune>
        <vcpupin cpuset="0" vcpu="0" />
    </cputune>

Comment 2 Arik 2017-08-23 12:17:02 UTC
(In reply to Yaniv Kaul from comment #1)
> Shira, it's quite clear the shares are missing from the libvirt XML, no?
> <cputune>
>         <vcpupin cpuset="0" vcpu="0" />
>     </cputune>

Seems it was never added to the libvirt XML.
VDSM used to set it by calling libvirt's setSchedulerParameters, that's why we missed it...

Comment 3 Michal Skrivanek 2017-08-23 12:24:09 UTC
*** Bug 1482484 has been marked as a duplicate of this bug. ***

Comment 4 Arik 2017-08-23 15:48:07 UTC
Shira, could you please verify it with the RPMs from:
http://jenkins.ovirt.org/job/ovirt-engine_master_build-artifacts-on-demand-el7-x86_64/353/

Comment 5 Shira Maximov 2017-08-24 11:49:27 UTC
The version of the rpms: http://jenkins.ovirt.org/job/ovirt-engine_master_build-artifacts-on-demand-el7-x86_64/353/ is bigger then the master, i can't install it.

Comment 6 Arik 2017-08-24 13:48:29 UTC
(In reply to Shira Maximov from comment #5)
New RPMs are available at:
http://jenkins.ovirt.org/job/ovirt-engine_master_build-artifacts-on-demand-el7-x86_64/354/

Comment 7 Arik 2017-08-24 14:42:11 UTC
The fix seems safe enough, merged to master.

Comment 8 Shira Maximov 2017-09-04 15:42:22 UTC
Try to verify on: Software version:4.2.0-0.0.master.20170901193740.git7900511.el7.centos

The verification of this bug succeeded ( steps mentioned in the description) 
but, 1482484 (Cpu Shares filed doesn't applied on next boot in case of update running VM)  you marked as duplicate, verification failed.

Michal, should i verify this bug and re-open 1482484 ? 
Or you prefer reassign this bug?

Comment 9 Michal Skrivanek 2017-09-06 16:56:39 UTC
Oh, if the other bug still fails please do reopen it and add new info. It must be a different issue afterall

Comment 10 Shira Maximov 2017-09-07 05:24:48 UTC
Verified this bug on Software version:4.2.0-0.0.master.20170901193740.git7900511.el7.centos

Steps to Verification:
1. Create 4 vms on the host, pin all vms to the same core (0#0)
2. Set the VMs cpu shares to low,low, medium and high  
3. Run 'dd if=/dev/zero of=/dev/null &' on each VM to load the cpu
4. Check the cpu usage of each VM in the host (with top)

Comment 11 Sandro Bonazzola 2017-12-20 11:05:27 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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