Description of problem: /System/CommonMethods/QuotaMethods quota_source method has code to enable user or group as the quota source instead of the tenant default quota source. It should'nt be necessary to modify a method to change the quota source. 1. Add an attribute to the class schema called quota_source and set the value to "tenant". 2. Modify the quota_source method to determine quota source from the attribute instead of being set in the method. Steps to Reproduce: 1. Test quota for both "tenant" and "group" quota_sources. 2. Make code changes described above. 3. Repeat step 1. Actual results: The results should be identical.
https://github.com/ManageIQ/manageiq/pull/7580
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/bdd8102d1ed76a2162283da3f9eaf07c45836d2e commit bdd8102d1ed76a2162283da3f9eaf07c45836d2e Author: william fitzgerald <wfitzger> AuthorDate: Tue Mar 29 15:16:08 2016 -0400 Commit: william fitzgerald <wfitzger> CommitDate: Fri Apr 1 17:06:59 2016 -0400 Automate - Change consolidated quota schema to add quota source attribute Added quota_source_type attribute to QuotaStateMachines class Modified quota_source.rb to determine quota type Updated quota_source spec https://bugzilla.redhat.com/show_bug.cgi?id=1319910 .../QuotaMethods.class/__methods__/quota_source.rb | 20 ++++----- .../QuotaStateMachine.class/__class__.yaml | 48 +++++++++++++++------- .../QuotaStateMachine.class/quota.yaml | 2 + .../unit/method_validation/quota_source_spec.rb | 17 ++++++-- 4 files changed, 58 insertions(+), 29 deletions(-)
Hi Milan, Since this commit only changes the way the quota source is updated, the best way to validate it is to look in the automation.log. The default quota_source is tenant. To validate: 1. Add tenant quota values <-- Configure/Configuration/Access Control/Tenants (There has to be at least one value set to run through quota) 2. Provision a VM or Service. 3. Check automation.log for ""Getting Tenant Quota Values for:" string. 4. Change quota_source value to group. <-- /System/CommonMethods/QuotaStateMachine 5. Repeat Step 2. 6. Check automation.log for "Getting Quota Values for Model:" string. Thanks, Tina
Verified in 5.6.0.5-beta2.4 With tenant (1000CPU, 1000G): [root@host vmdb]# tail -fn0 log/automation.log | egrep "Getting Tenant Quota Values for" [----] I, [2016-05-09T07:22:00.401532 #3113:5b72154] INFO -- : Q-task_id([miq_provision_request_2]) <AEMethod limits> Getting Tenant Quota Values for: {:cpu=>1000, :memory=>1073741824000} When changed to group (copied the instance to new domain and changed): [root@host vmdb]# tail -fn0 log/automation.log | egrep "Getting Quota Values" [----] I, [2016-05-09T07:49:52.707815 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: max_storage Tag Name: quota_max_storage [----] I, [2016-05-09T07:49:52.716141 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: warn_storage Tag Name: quota_warn_storage [----] I, [2016-05-09T07:49:52.720514 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: max_vms Tag Name: quota_max_vms [----] I, [2016-05-09T07:49:52.725106 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: warn_vms Tag Name: quota_warn_vms [----] I, [2016-05-09T07:49:52.729498 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: max_cpu Tag Name: quota_max_cpu [----] I, [2016-05-09T07:49:52.734239 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: warn_cpu Tag Name: quota_warn_cpu [----] I, [2016-05-09T07:49:52.740821 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: max_memory Tag Name: quota_max_memory [----] I, [2016-05-09T07:49:52.745382 #3119:ff472c] INFO -- : Q-task_id([miq_provision_request_5]) <AEMethod limits> Getting Quota Values for Model: warn_memory Tag Name: quota_warn_memory Discovered https://bugzilla.redhat.com/show_bug.cgi?id=1334318 in the process.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1348