Bug 1543098

Summary: Quota - Active provisions calculations allow quota to be over allocated
Product: Red Hat CloudForms Management Engine Reporter: Tina Fitzgerald <tfitzger>
Component: ApplianceAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.10.0CC: abellott, cpelland, obarenbo
Target Milestone: GAKeywords: TestOnly
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1543171 1543172 (view as bug list) Environment:
Last Closed: 2018-06-21 21:03:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1543171, 1543172    

Description Tina Fitzgerald 2018-02-07 17:48:20 UTC
Description of problem:

Active provision calculations were using very specific MiqQueue entries to include for the active counts. MiqQueue entries are transient and some MiqQueue entries state changes disqualify them from being included in the active counts. This caused the total active provision quota counts, at times, to be understated which caused quota to be over allocated.

We changed the way we calculate quota to use MiqRequest entries which gives us a much more accurate count of active provisions and will prevent quota from being over allocated. 
     

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


How reproducible:
Can reproduce most of the time, is timing sensitive.

Steps to Reproduce:
1. Setup Tenant Quota Limits for VMs only so that there are 3 available VMs.
2. Create a new Service to provision 3 VMs(Do not use dialog to override the number of VMs or any quota value)
3. Order the Service for the tenant user from 2 different browsers.
4. Notice that only 1 of the Services passed quota, when previously, it would have allowed both Services to pass quota. 
***Important Note - It's possible, based on timing, that both Services would be denied due to quota limits because each Service Request counted the other Service request. This is expected behavior.  If this happens, order another Service and see that it passed quota.    

Actual results:
Over allocated Quota. 

Expected results:
Proper allocation for Quota. 

Additional info:
Fix Initially applied here:
https://bugzilla.redhat.com/show_bug.cgi?id=1489507