Hello @tinaafitz !
Thank you for your reply.
First of all for service provisioning options still not properly checked. You can analyze that “dialog_” prefixed options are collected to related options_hash:
https://github.com/ManageIQ/manageiq/blob/euwe/db/fixtures/ae_datastore/ManageIQ/System/CommonMethods/QuotaMethods.class/methods/requested.rb#L230
but values of this hash never accessed by its “dialog_” prefixed names:
https://github.com/ManageIQ/manageiq/blob/euwe/db/fixtures/ae_datastore/ManageIQ/System/CommonMethods/QuotaMethods.class/methods/requested.rb#L153
Second unresolved drawback is for number_of_vms for cloud instances provisioning. As you can see from my logs:
<AutomationEngine> <AEMethod requested> Request: Provision from [Red Hat Enterprise Linux 7] to [server###] id: 148
<AutomationEngine> <AEMethod requested> Retrieving flavor t1.2medium memory => 4294967296
<AutomationEngine> <AEMethod requested> Retrieving cloud flavor t1.2medium cpus => 4
<AEMethod validate_quota> Request: Provision from [Red Hat Enterprise Linux 7] to [server###] id: 148
<AEMethod validate_quota> quota_warning: {:cpu=>0, :memory=>0, :storage=>0, :vms=>0}
<AEMethod validate_quota> quota_limits: {:memory=>85899345920, :vms=>20, :storage=>3324304687104, :cpu=>46}
<AEMethod validate_quota> Item: storage Used: (1715839434752) Requested: (68719476736) Max: (3324304687104) Warn: (0)
<AEMethod validate_quota> Item: vms Used: (6) Requested: (2) Max: (20) Warn: (0)
<AEMethod validate_quota> Item: cpu Used: (32) Requested: (4) Max: (46) Warn: (0)
<AEMethod validate_quota> Item: memory Used: (51136954368) Requested: (4294967296) Max: (85899345920) Warn: (0)
As you can see, I requested two instances with flavor t1.2medium (t1.2medium cpus => 4, t1.2medium memory => 4294967296 and 60Gb root disk). But quota calculated only for one instance.
You can found that for Infrastructure Providers there is correct calculation for number of vms:
for memory:
https://github.com/ManageIQ/manageiq/blob/euwe/db/fixtures/ae_datastore/ManageIQ/System/CommonMethods/QuotaMethods.class/methods/requested.rb#L106
and for cpus:
https://github.com/ManageIQ/manageiq/blob/euwe/db/fixtures/ae_datastore/ManageIQ/System/CommonMethods/QuotaMethods.class/methods/requested.rb#L114
But for cloud instances there is no multiplying by the number of provisioned instances. There is my override to workaround all these issues:
There is another major architectural issue that I would like to draw special attention - Requested resources does not allocated before provisioning and quota can be exeeded during simultaneous requests.
Quotas are fixed only after provisioning of resources. In this case a large number of simultaneous requests can significantly exceed the allocated quotas. A relatively small number of users (i.e. one hundred) simultaneously or with some short difference in time can execute a request to provision one small virtual machine. The quota validation workflow checks each request individually and each small request passes a quota check, although all requests in aggregate can significantly exceed the limits.
I can say that to reproduce this problem you can use two users. Each user executes the provisioning request. Second user should send a request before virtual machines of first user are provisioned.