Bug 854491

Summary: When quota is enforced - statless vm is counted twice.
Product: Red Hat Enterprise Virtualization Manager Reporter: ofri <omasad>
Component: ovirt-engineAssignee: ofri <omasad>
Status: CLOSED CURRENTRELEASE QA Contact: Dafna Ron <dron>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: acathrow, dfediuck, dyasny, iheim, lpeer, Rhev-m-bugs, yeylon, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sla
Fixed In Version: si20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:03:44 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: 863766    
Bug Blocks:    
Attachments:
Description Flags
log none

Description ofri 2012-09-05 07:32:27 UTC
Description of problem:
When quota is enforced. Runnig a statless VM will count the cpu and memory of the vm twice (thus, sometimes blockong the run)


How reproducible:
100%

Steps to Reproduce:
1. set quota to enforce
2. applay a 1024 MB mem quota to a 1024 MB VM
3. run the VM once (as stateless)
  
Actual results:
fails to run - quota dont have suficient memory,

Expected results:
should run

Additional info:

Comment 1 ofri 2012-09-05 08:52:23 UTC
posted to upstream: http://gerrit.ovirt.org/#/c/7762/

Comment 3 Dafna Ron 2012-09-21 09:23:06 UTC
tested in si18 - failed QE
I created a quota with mem use of 1024
created a vm with mem of 1024

when we run the vm as stateless we are blocked by quota
when we run the vm without the stateless tag we are able to run the vm 

moving back to devel

2012-09-21 12:17:14,918 WARN  [org.ovirt.engine.core.bll.RunVmCommand] (pool-4-thread-43) CanDoAction of action RunVm failed. Reasons:VAR__ACTION__RUN,VAR__TYPE__VM,ACTION_TYPE
_FAILED_QUOTA_VDS_GROUP_LIMIT_EXCEEDED,$VmName GHGH

Comment 4 Dafna Ron 2012-09-21 09:23:47 UTC
Created attachment 615314 [details]
log

Comment 5 ofri 2012-09-24 11:38:41 UTC
Unable to reproduce. Please provide a reproducer.

Comment 6 Dafna Ron 2012-09-25 10:46:41 UTC
Ofri, I tested again in si18.1 and its reproduced. 
please try with iscsi storage, one host
1. move the DC  to enforce quota
2. create unlimited quota
3. create a vm with mem of 512
4. edit the quota and select specific cluster -> limit memory to 512
5. run the vm -> vm should run
6. edit vm and add the stateless tag 
7. run vm -> vm fails to run with canDoAction: 

2012-09-25 12:48:26,938 WARN  [org.ovirt.engine.core.bll.RunVmCommand] (pool-4-thread-43) CanDoAction of action RunVm failed. Reasons:VAR__ACTION__RUN,VAR__TYPE__VM,ACTION_TYPE_FAILED_QUOTA_VDS_GROUP_LIMIT_EXCEEDED,$VmName Quota1_VM

Comment 7 ofri 2012-09-27 08:39:12 UTC
Bug is reproduced only when the stateless is triggered on the VM edit pop-up (not when stateless is triggered on the Run once pop-up).
Posted to upstream: http://gerrit.ovirt.org/#/c/8223/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java

Comment 9 Dafna Ron 2012-10-07 10:21:38 UTC
blocked by https://bugzilla.redhat.com/show_bug.cgi?id=863766

Comment 10 Dafna Ron 2012-10-29 16:00:01 UTC
verified on si22.1