Bug 1497912

Summary: Provisioning multiple VMs using service dialogs do not honour quotas
Product: Red Hat CloudForms Management Engine Reporter: Sachin <sacpatil>
Component: AutomateAssignee: William Fitzgerald <wfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Vatsal Parekh <vparekh>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: akarol, cpelland, greartes, igortiunov, jhardy, mkanoor, obarenbo, sacpatil, simaishi, smallamp, tfitzger, vparekh, wfitzger
Target Milestone: GA   
Target Release: 5.8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: quota:service
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-17 20:19:14 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:
Bug Depends On:    
Bug Blocks: 1489507    

Description Sachin 2017-10-03 06:11:51 UTC
Description of problem:

Seems when provisioning multiple VMs using life-cycle the quota issue is fixed in BZ#1465087 but the issue still exist when provisioning VMs using service dialogs(field: number_of_vms). 

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

How reproducible:

Steps to Reproduce:
1. Create a service dialog with field: number_of_vms
2. Attach that dialog to catalog
3. set 'max_vms' to value 5 in  / Custom / Cloud / VM / Provisioning / StateMachines / ProvisionRequestApproval / Default
4. Provision 10 vms 

Actual results:

Expected results:

Additional info:

Comment 2 Dave Johnson 2017-10-03 06:44:56 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set it to Low/Low.

Comment 7 William Fitzgerald 2017-11-22 15:17:16 UTC

 Can you reproduce this issue and send us the appliance information?



Comment 11 William Fitzgerald 2017-11-28 16:17:12 UTC

I changed your dialog field name to option_0_number_of_vms.

I changed tenant quota to Allocated Number of Virtual Machines to 1.

When I order the service, Quota denies it.

This is working for me.



Comment 13 Tina Fitzgerald 2017-11-29 20:11:59 UTC
Hi Vatsal,

As Billy mentioned in comment 11, he changed the Tenant quota Allocated number of Virtual machines to 1. When we checked your appliance logs, we noticed that there were no quota limits set, so quota was not used. You need to set at least one Tenant quota value to enable quota.

Let me know if you have any questions.


Comment 14 Vatsal Parekh 2017-11-30 12:36:02 UTC
(In reply to William Fitzgerald from comment #11)
> Vatsal,
> I changed your dialog field name to option_0_number_of_vms.
> I changed tenant quota to Allocated Number of Virtual Machines to 1.
> When I order the service, Quota denies it.
> This is working for me.
> Thanks 
> Billy

Can you please let me know on which version it is fixed and shipped for on_qa?

Comment 15 William Fitzgerald 2017-11-30 17:56:36 UTC

It should be fixed on 5.7 also.


Comment 16 Vatsal Parekh 2017-12-05 15:21:38 UTC
Closing this BZ, as it is working as expected.

Comment 23 CFME Bot 2018-04-18 19:32:49 UTC
New commit detected on ManageIQ/manageiq-content/master:

commit 53f0acd0d1d32aa339da08d2f2d23b8d9cbefdcc
Author:     william fitzgerald <wfitzger@redhat.com>
AuthorDate: Wed Oct 25 11:40:49 2017 -0400
Commit:     william fitzgerald <wfitzger@redhat.com>
CommitDate: Wed Oct 25 11:40:49 2017 -0400

    Calculate quota using service dialogs overrides.

    Changed requested method to use dialog overrides in quota calculations.

    Modified requested method to calculate quota based on dialog values for:
    number_of_sockets, cores_per_socket, number_of_cpus, vm_memory and storage.

    This can be tested by using service dialogs using these values.



    Create a service using service dialog overrides values for the above values.
    You can use one or more override values.
    Order the service, change some values and run.

    Note: We are honoring number_of_vms in a service dialog but not using number_of_vms in quota calculations. Doing quota calculations for number_of_vms in a service dialog will be in
    a followup PR.

    I am including screenshots of a dialog using some values.

 content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/requested.rb | 35 +-
 spec/automation/unit/method_validation/calculate_requested_spec.rb | 83 +
 2 files changed, 116 insertions(+), 2 deletions(-)