Bug 1333698 - When quota source is group display quota exceed message for which the quota is validated for
Summary: When quota source is group display quota exceed message for which the quota i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.7.0
Assignee: William Fitzgerald
QA Contact: Aziza Karol
URL:
Whiteboard: quota
Depends On:
Blocks: 1347018
TreeView+ depends on / blocked
 
Reported: 2016-05-06 07:43 UTC by Aziza Karol
Modified: 2017-01-12 05:10 UTC (History)
9 users (show)

Fixed In Version: 5.7.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1347018 (view as bug list)
Environment:
Last Closed: 2017-01-11 20:26:50 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
snapshot (91.93 KB, image/png)
2016-05-06 07:43 UTC, Aziza Karol
no flags Details
message (85.84 KB, image/png)
2016-05-25 10:15 UTC, Aziza Karol
no flags Details

Description Aziza Karol 2016-05-06 07:43:50 UTC
Created attachment 1154504 [details]
snapshot

Description of problem:
When quota source is tenant, quota exceed message is displayed only for which the quota is enforced but when quota source is group, quota exceed message is displayed for all. ie(cpu,memory, storage)

Version-Release number of selected component (if applicable):
5.6.0.5-beta2.4.20160503153816_1fb554f 

How reproducible:
100%

Steps to Reproduce:
using the automate explorer:
1) Copy the /System/CommonMethods/QuotaMethods/quota_source method to a writable enabled domain.

quota_source method.
#
# Description: Get quota source.
#

@miq_request = $evm.root['miq_request']
$evm.root['quota_source_type'] = $evm.parent['quota_source_type'] || $evm.object['quota_source_type']

if $evm.root['quota_source_type'].casecmp('group').zero?
  $evm.root['quota_source'] = @miq_request.requester.current_group
else
  $evm.root['quota_source'] = @miq_request.tenant
  $evm.root['quota_source_type'] = 'tenant'
end

2) Edit the copied quota_source method:
  a.set the quota_source_type to group.
3) Validate and save method.
4) Copy the /System/CommonMethods/QuotaStateMachine/Quota instance to a writable enabled domain.
5) Modify the copied Quota instance to set desired quota test values. for ex: set the quota for cpu only or you can also set it by tagging.
6) Run test(Provision service and/or VMs).


Actual results:
Request exceeds maximum allowed for the following: (cpu - Used: 0 plus requested: 8 exceeds quota: 1) (memory - Used: 0 Bytes plus requested: 1.00 GB exceeds quota: 2.00 KB) (storage - Used: 0 Bytes plus requested: 192.00 MB exceeds quota: 2.00 KB)  is displayed when quota is set only for cpu. see attached screenshot.

Expected results:
quota exceed message should be displayed only for which the quota is enforce for.

Additional info:

Comment 2 William Fitzgerald 2016-05-06 14:17:38 UTC
Aziza,

Can I access your appliance?

Billy

Comment 4 William Fitzgerald 2016-05-10 19:19:58 UTC
Issues fixed here: https://github.com/ManageIQ/manageiq/pull/7933

Comment 5 Aziza Karol 2016-05-25 10:13:58 UTC
When the quota source is group or tenant,the last message always is displayed as "VM Provisioning - Request Created". see attached screenshot.

No such message "Request exceeds maximum allowed for the following: (cpu - Used: 0 plus requested: 8 exceeds quota: 1)".... is displayed in Last Message.


Version:5.6.0.7-beta2.6.20160516171555_b1be31f

Comment 6 Aziza Karol 2016-05-25 10:15:24 UTC
Created attachment 1161375 [details]
message

Comment 7 Aziza Karol 2016-05-31 15:22:33 UTC
William,

When quota exceeds the last message in request detail displayed is misleading,it does not display the actual reason for quota exceeded but always displays "VM Provisioning - Request Created".see attached screenshot.

Is anything changed related to messages being displayed? 
I think the actual reason for quota exceeded should be displayed.

~Thanks,
Aziza

Comment 9 CFME Bot 2016-06-03 21:25:54 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/df1a627d3529374ab053ab9bfa3cc50f05bbaf87

commit df1a627d3529374ab053ab9bfa3cc50f05bbaf87
Author:     Tina Fitzgerald <tfitzger>
AuthorDate: Thu Jun 2 17:19:48 2016 -0400
Commit:     Tina Fitzgerald <tfitzger>
CommitDate: Fri Jun 3 16:27:01 2016 -0400

    Fix validate_quota method to properly set the request.message for quota
    exceeded and modified tests to check request.message.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1333698

 .../QuotaMethods.class/__methods__/validate_quota.rb        | 13 +++++--------
 .../service_models/miq_ae_service_miq_request.rb            |  2 +-
 .../unit/method_validation/validate_quota_spec.rb           |  8 ++++++++
 3 files changed, 14 insertions(+), 9 deletions(-)

Comment 13 Aziza Karol 2016-07-21 11:12:12 UTC
The request message for quota exceeded is not displayed in 5.5.5.3 too.

Comment 14 Aziza Karol 2016-10-06 09:55:36 UTC
When quota source is group/user,quota exceed messages are displayed for which the quota is validated for.

Verified:5.7.0.3.20160927165516_075d0f3


Note You need to log in before you can comment on or make changes to this bug.