Description of problem: Setting quota for cpu against a tenant doesn't deny request when quota is surpassed Version-Release number of selected component (if applicable): 5.7.2.1 How reproducible: Always Steps to Reproduce: 1. Configuration>Access control accordion>tenants>select a child tenant and choose manage quotas. 2. Set enforce to a number 3. Provision vms against tenant that go above the cpu quota Actual results: Lifecycle requests follow the quota restriction Service requests do not Expected results: request denied Additional info: When I set up a quota the limits are not respected, for instance, applying a quota limit of 8cpu for a tenant and create vms until reach 7cpu, I still can order a vm with 2 or more cpus. I my humble opinion the correct behavior is not to create any vms over the limit
Hi Ryan, My understanding is that this is Service sub tenant quota issue. I'd like to determine if the sub-tenant is the issue here. Can you ask the customer to provision a Service with the same quota values, except that they should use a top level tenant. Are they using Generic Services(cloudforms_essentials)? Thanks, Tina
Can we ask them for the Automate model?
I am wondering if this is related to bug 1401251???
Hi Saif, After further investigation, I don't believe this is a tenant issue. Please ask the customer to disregard my request to test using a top level tenant. I'm going to check out the customer provided Automate domain. Thanks, Tina
Hi Saif, We have an updated Automate method we'd like the customer to test in their environment on a single appliance. Would you ask the customer to: 1. Provision the Service they used as an example where the dialog_option_0_cores_per_socket = 8 and dialog_option_0_vm_memory = 8192. 2. Create a new domain called quota_test. 3. Using the Automate Explorer, copy the ManageIQ/System/CommonMethods/QuotaMethods/requested method to the quota_test domain. 3. Edit the quota_test/System/CommonMethods/QuotaMethods/requested method and replace the contents with the contents of the attached requested method. 4. Provision the Service from step 1 and note the difference in quota calculations. 5. Send us the logs along with the Service request ID's from step 1 and step 4 if the quota calculations are not as expected. Let me know if you have any questions. Thanks, Tina
Created attachment 1331223 [details] Custom Quota Requested Automate Method
Hi Yoder, The customer provided logs show the Automate method changes worked properly. They're running into a different issue where the active provisions are not counted towards quota limits. We've added the active provision quota changes, but I don't think they're back ported to 5.7. Here's the before and after logging: task 384(before changes) [----] I, [2017-10-02T09:47:31.563469 #19176:50d2dc0] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod requested> Adding seq_id: 0 key: :vm_name value: "021017-01" to options_hash [----] I, [2017-10-02T09:47:31.564463 #19176:50d2dc0] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod requested> Adding seq_id: 0 key: :cores_per_socket value: 8 to options_hash [----] I, [2017-10-02T09:47:31.565435 #19176:50d2dc0] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod requested> Adding seq_id: 0 key: :vm_memory value: 8192 to options_hash [----] I, [2017-10-02T09:47:31.566560 #19176:50d2dc0] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod requested> Inspecting options_hash: {"0"=>{:vm_name=>"021017-01", :cores_per_socket=>8, :vm_memory=>8192}} ..... [----] I, [2017-10-02T09:47:31.904370 #19176:a4f13c] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) Invoking [inline] method [/ManageIQ/System/CommonMethods/QuotaMethods/validate_quota] with inputs [{}] [----] I, [2017-10-02T09:47:31.905930 #19176:a4f13c] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/validate_quota]> Starting [----] I, [2017-10-02T09:47:32.486685 #19176:6a9ee34] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod validate_quota> Request: Provisioning Service [ETCRV01] from [ETCRV01] id: 1000000000384 [----] I, [2017-10-02T09:47:32.489043 #19176:6a9ee34] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod validate_quota> quota_warning: {:cpu=>0, :memory=>0, :storage=>0, :vms=>0} [----] I, [2017-10-02T09:47:32.490031 #19176:6a9ee34] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod validate_quota> quota_limits: {:cpu=>8, :memory=>34359738368, :storage=>214748364800} [----] I, [2017-10-02T09:47:32.490976 #19176:6a9ee34] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod validate_quota> Item: storage Used: (0) Requested: (55834574848) Max: (214748364800) Warn: (0) [----] I, [2017-10-02T09:47:32.491887 #19176:6a9ee34] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod validate_quota> Item: vms Used: (0) Requested: (1) Max: (0) Warn: (0) cpu requested = 1 [----] I, [2017-10-02T09:47:32.492768 #19176:6a9ee34] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod validate_quota> Item: cpu Used: (0) Requested: (1) Max: (8) Warn: (0) memory requested = 2147483648 [----] I, [2017-10-02T09:47:32.493699 #19176:6a9ee34] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod validate_quota> Item: memory Used: (0) Requested: (2147483648) Max: (34359738368) Warn: (0) [----] I, [2017-10-02T09:47:32.522604 #19176:a4f13c] INFO -- : Q-task_id([service_template_provision_request_1000000000384]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/validate_quota]> Ending task 387(after) [----] I, [2017-10-02T10:33:32.529837 #18683:7041288] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod requested> Adding seq_id: 0 key: :vm_name value: "021017-04" to options_hash [----] I, [2017-10-02T10:33:32.530880 #18683:7041288] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod requested> Adding seq_id: 0 key: :cores_per_socket value: 8 to options_hash [----] I, [2017-10-02T10:33:32.531784 #18683:7041288] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod requested> Adding seq_id: 0 key: :vm_memory value: 8192 to options_hash [----] I, [2017-10-02T10:33:32.532763 #18683:7041288] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod requested> Inspecting options_hash: {"0"=>{:vm_name=>"021017-04", :cores_per_socket=>8, :vm_memory=>8192}} [----] I, [2017-10-02T10:33:32.550133 #18683:7041288] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod requested> service_template id: 1000000000012 service_type: atomic [----] I, [2017-10-02T10:33:32.683437 #18683:7041288] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod requested> Recalculating number of cpus based on dialog overrides [----] I, [2017-10-02T10:33:32.696873 #18683:7041288] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod requested> Recalculating the number_of_cpus resource: #<MiqAeMethodService::MiqAeServiceMiqProvisionRequestTemplate:0x0000000d49c2f0> override_number_of_sockets: 0 override_cores_per_socket: 8 ............... ----] I, [2017-10-02T10:33:32.750443 #18683:118f140] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) Following Relationship [miqaedb:/System/CommonMethods/QuotaMethods/validate_quota#create] [----] I, [2017-10-02T10:33:32.832205 #18683:118f140] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) Updated namespace [miqaedb:/System/CommonMethods/QuotaMethods/validate_quota#create ManageIQ/System/CommonMethods] [----] I, [2017-10-02T10:33:32.917246 #18683:118f140] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) Updated namespace [System/CommonMethods/QuotaMethods/validate_quota ManageIQ/System/CommonMethods] [----] I, [2017-10-02T10:33:32.933717 #18683:118f140] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) Invoking [inline] method [/ManageIQ/System/CommonMethods/QuotaMethods/validate_quota] with inputs [{}] [----] I, [2017-10-02T10:33:32.935291 #18683:118f140] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/validate_quota]> Starting [----] I, [2017-10-02T10:33:33.499899 #18683:6a6c3f8] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod validate_quota> Request: Provisioning Service [ETCRV01] from [ETCRV01] id: 1000000000387 [----] I, [2017-10-02T10:33:33.502589 #18683:6a6c3f8] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod validate_quota> quota_warning: {:cpu=>0, :memory=>0, :storage=>0, :vms=>0} [----] I, [2017-10-02T10:33:33.503660 #18683:6a6c3f8] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod validate_quota> quota_limits: {:cpu=>8, :memory=>34359738368, :storage=>214748364800} [----] I, [2017-10-02T10:33:33.504713 #18683:6a6c3f8] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod validate_quota> Item: storage Used: (0) Requested: (55834574848) Max: (214748364800) Warn: (0) [----] I, [2017-10-02T10:33:33.505743 #18683:6a6c3f8] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod validate_quota> Item: vms Used: (0) Requested: (1) Max: (0) Warn: (0) cpu requested = 8 [----] I, [2017-10-02T10:33:33.506751 #18683:6a6c3f8] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod validate_quota> Item: cpu Used: (0) Requested: (8) Max: (8) Warn: (0) memory requested = 8192 [----] I, [2017-10-02T10:33:33.507805 #18683:6a6c3f8] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod validate_quota> Item: memory Used: (0) Requested: (8192) Max: (34359738368) Warn: (0) [----] I, [2017-10-02T10:33:33.537080 #18683:118f140] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/validate_quota]> Ending [----] I, [2017-10-02T10:33:33.537386 #18683:118f140] INFO -- : Q-task_id([service_template_provision_request_1000000000387]) Method exited with rc=MIQ_OK If the customer wants to verify this, they can run some/all of the previous steps, but wait for each previous provision to finish prior to ordering a second provision. Let me know if you have any questions. Thanks, Tina
Hi Yoder, Yes, that is the bug. :-) I think we can back port it to 5.7..... I'll find out and report back here. The back ported changes would be for the back end and the customer would still need an Automate method fix. Thanks, Tina
Hey, Tina. Any news on if this can be backported?
New commit detected on ManageIQ/manageiq/euwe: https://github.com/ManageIQ/manageiq/commit/fd5829a15f16551a99e01664000e7719f82db842 commit fd5829a15f16551a99e01664000e7719f82db842 Author: Madhu Kanoor <mkanoor> AuthorDate: Thu Sep 14 16:01:47 2017 -0400 Commit: Satoe Imaishi <simaishi> CommitDate: Mon Oct 9 15:38:22 2017 -0400 Merge pull request #69 from tinaafitz/add_quota_mixin Add missing service model change for calculating active quota counts for Service requests. (cherry picked from commit ca32a7918cd0e9a5664e5eb4b44d9b11458037e6) https://bugzilla.redhat.com/show_bug.cgi?id=1492158 .../miq_ae_service_service_template_provision_request.rb | 3 +++ 1 file changed, 3 insertions(+)
New commit detected on ManageIQ/manageiq/euwe: https://github.com/ManageIQ/manageiq/commit/8f1ca34da55a81bbdb149f0246e7cd0d18c1a4ba commit 8f1ca34da55a81bbdb149f0246e7cd0d18c1a4ba Author: william fitzgerald <wfitzger> AuthorDate: Fri Oct 13 13:11:18 2017 -0400 Commit: william fitzgerald <wfitzger> CommitDate: Fri Oct 27 14:06:09 2017 -0400 Automate - Calculate quota using service dialogs overrides. Modified requested method to calculate quota based on dialog values for: number_of_sockets, cores_per_socket, number_of_cpus, vm_memory and storage. Added tests for dialog values and the quota calculations. https://bugzilla.redhat.com/show_bug.cgi?id=1492158 .../QuotaMethods.class/__methods__/requested.rb | 43 +++++++++-- .../method_validation/calculate_requested_spec.rb | 83 ++++++++++++++++++++++ 2 files changed, 121 insertions(+), 5 deletions(-)
Thanks Billy for verifying the configuration. Tested provisioning with user as a sub-tenant by overriding the dialogs. Quota calculation using service dialog overrides works fine. Also tested for quota source type user and groups. Verified:5.7.4.1.20171114202358_de8178a
Created attachment 1359431 [details] quota overrides
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/RHSA-2017:3484
Clearing needinfo