Implement Quota service - #768
Conversation
|
cloudstack-pull-rats #458 SUCCESS |
|
cloudstack-pull-rats #459 SUCCESS |
|
cloudstack-pull-rats #460 SUCCESS |
|
cloudstack-pull-analysis #391 ABORTED |
|
cloudstack-pull-rats #461 SUCCESS |
|
cloudstack-pull-analysis #392 SUCCESS |
|
cloudstack-pull-analysis #393 ABORTED |
|
cloudstack-pull-analysis #394 ABORTED |
|
cloudstack-pull-rats #464 SUCCESS |
|
cloudstack-pull-rats #465 SUCCESS |
|
cloudstack-pull-rats #466 SUCCESS |
|
cloudstack-pull-analysis #397 SUCCESS |
|
cloudstack-pull-analysis #398 ABORTED |
|
cloudstack-pull-analysis #399 ABORTED |
|
cloudstack-pull-rats #474 SUCCESS |
|
cloudstack-pull-analysis #407 ABORTED |
|
Previously, I expressed concerns that the pattern of opening and immediately closing transactions on |
|
cloudstack-pull-rats #476 SUCCESS |
|
cloudstack-pull-rats #477 SUCCESS |
|
cloudstack-pull-rats #478 SUCCESS |
|
cloudstack-pull-rats #479 SUCCESS |
|
cloudstack-pull-rats #480 SUCCESS |
|
cloudstack-pull-analysis #409 UNSTABLE |
There was a problem hiding this comment.
Since Dates are mutable, a copy of endDate should be returned to avoid downstream side effects.
|
@remibergsma I have reviewed the code. I found a couple of minor issues. Namely, that dates are not being defensively copied in a variety of places. These fixes are very simple to implement. The only other items I noticed were a number of unit test methods with no asserts. Hopefully, it will be relatively simple to add some asserts to verify correctness of the methods being tested. |
Quota service while allowing for scalability will make sure that the cloud is not exploited by attacks, careless use and program errors. To address this problem, we propose to employ a quota-enforcement service that allows resource usage within certain bounds as defined by policies and available quotas for various entities. Quota service extends the functionality of usage server to provide a measurement for the resources used by the accounts and domains using a common unit referred to as cloud currency in this document. It can be configured to ensure that your usage won’t exceed the budget allocated to accounts/domain in cloud currency. It will let user know how much of the cloud resources he is using. It will help the cloud admins, if they want, to ensure that a user does not go beyond his allocated quota. Per usage cycle if a account is found to be exceeding its quota then it is locked. Locking an account means that it will not be able to initiat e a new resource allocation request, whether it is more storage or an additional ip. Needless to say quota service as well as any action on the account is configurable. Changes from Github code review: - added marvin test for quota plugin API - removed unused commented code - debug messages in debug enabled check - checks for nulls, fixed access to member variables and feature - changes based on PR comments - unit tests for UsageTypes - unit tests for all Cmd classes - unit tests for all service and manager impls - try-catch-finally or try-with-resource in dao impls for failsafe db switching - remove dead code - add missing quota calculation case (regression fixed) - replace tabs with spaces in pom.xmls - quota: though default value for quota_calculated is 0, the usage server makes it null while entering usage entries. Flipping the condition so as to acocunt for that. - quotatypes: fix NPE in quota type - quota framework test fixes - Made statement period configurable - Changed default email templates to reflect the fact that exhausted quota may not result in a locked account - Added quotaUpdateCmd that refreshes quota balances and sends alerts and statements - Report quotaSummary command returns quota balance, quota usage and state for all account - Made UI framework changes to allow for text area input in edit views - Process usage entries that have greater than 0 usage - Process quota entries only if tariff is non zero - If there are credit entries but no balance entry create a dummy balance entry - Remove any credit entries that are before the last balance entry when displaying balance statement FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Quota+Service+-+FS PR: apache#768 Signed-off-by: Rohit Yadav <[email protected]>
|
Abhi has fixed the issues, changes are now incorporated, commits squashed into one. LGTM, let's merge this before EOD. |
|
@bhaisaab @remibergsma there is still one issue that I am looking at now. |
|
@agneya2001 OK, please ping me when done! |
|
@bhaisaab Minor thing: could you also rename the title to "Implement Quota service"? I will make sure it will be merged before we freeze. |
|
@remibergsma sure, I'm discussing with Abhi on that minor fix. After that, will squash/amend the message in the git log. |
|
@bhaisaab the issue is resolved. |
|
@agneya2001 thanks, squashing the change and pushing now. |
Quota service while allowing for scalability will make sure that the cloud is not exploited by attacks, careless use and program errors. To address this problem, we propose to employ a quota-enforcement service that allows resource usage within certain bounds as defined by policies and available quotas for various entities. Quota service extends the functionality of usage server to provide a measurement for the resources used by the accounts and domains using a common unit referred to as cloud currency in this document. It can be configured to ensure that your usage won’t exceed the budget allocated to accounts/domain in cloud currency. It will let user know how much of the cloud resources he is using. It will help the cloud admins, if they want, to ensure that a user does not go beyond his allocated quota. Per usage cycle if a account is found to be exceeding its quota then it is locked. Locking an account means that it will not be able to initiat e a new resource allocation request, whether it is more storage or an additional ip. Needless to say quota service as well as any action on the account is configurable. Changes from Github code review: - Added marvin test for quota plugin API - removed unused commented code - debug messages in debug enabled check - checks for nulls, fixed access to member variables and feature - changes based on PR comments - unit tests for UsageTypes - unit tests for all Cmd classes - unit tests for all service and manager impls - try-catch-finally or try-with-resource in dao impls for failsafe db switching - remove dead code - add missing quota calculation case (regression fixed) - replace tabs with spaces in pom.xmls - quota: though default value for quota_calculated is 0, the usage server makes it null while entering usage entries. Flipping the condition so as to acocunt for that. - quotatypes: fix NPE in quota type - quota framework test fixes - made statement period configurable - changed default email templates to reflect the fact that exhausted quota may not result in a locked account - added quotaUpdateCmd that refreshes quota balances and sends alerts and statements - report quotaSummary command returns quota balance, quota usage and state for all account - made UI framework changes to allow for text area input in edit views - process usage entries that have greater than 0 usage - orocess quota entries only if tariff is non zero - if there are credit entries but no balance entry create a dummy balance entry - remove any credit entries that are before the last balance entry when displaying balance statement - on a rerun the last balance is now getting added FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Quota+Service+-+FS PR: apache#768 Signed-off-by: Rohit Yadav <[email protected]>
Quota service while allowing for scalability will make sure that the cloud is not exploited by attacks, careless use and program errors. To address this problem, we propose to employ a quota-enforcement service that allows resource usage within certain bounds as defined by policies and available quotas for various entities. Quota service extends the functionality of usage server to provide a measurement for the resources used by the accounts and domains using a common unit referred to as cloud currency in this document. It can be configured to ensure that your usage won’t exceed the budget allocated to accounts/domain in cloud currency. It will let user know how much of the cloud resources he is using. It will help the cloud admins, if they want, to ensure that a user does not go beyond his allocated quota. Per usage cycle if a account is found to be exceeding its quota then it is locked. Locking an account means that it will not be able to initiat e a new resource allocation request, whether it is more storage or an additional ip. Needless to say quota service as well as any action on the account is configurable. Changes from Github code review: - Added marvin test for quota plugin API - removed unused commented code - debug messages in debug enabled check - checks for nulls, fixed access to member variables and feature - changes based on PR comments - unit tests for UsageTypes - unit tests for all Cmd classes - unit tests for all service and manager impls - try-catch-finally or try-with-resource in dao impls for failsafe db switching - remove dead code - add missing quota calculation case (regression fixed) - replace tabs with spaces in pom.xmls - quota: though default value for quota_calculated is 0, the usage server makes it null while entering usage entries. Flipping the condition so as to acocunt for that. - quotatypes: fix NPE in quota type - quota framework test fixes - made statement period configurable - changed default email templates to reflect the fact that exhausted quota may not result in a locked account - added quotaUpdateCmd that refreshes quota balances and sends alerts and statements - report quotaSummary command returns quota balance, quota usage and state for all account - made UI framework changes to allow for text area input in edit views - process usage entries that have greater than 0 usage - orocess quota entries only if tariff is non zero - if there are credit entries but no balance entry create a dummy balance entry - remove any credit entries that are before the last balance entry when displaying balance statement - on a rerun the last balance is now getting added FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Quota+Service+-+FS PR: apache#768 Signed-off-by: Rohit Yadav <[email protected]>
|
@remibergsma LGTM, final issue fixed. Let's merge now! |
Implement Quota serviceThis pull request is for quota service implementation, divided into following commits: Quota server side implementation a. Quota Framework plugin containing Daos b. Quota database plugin for quota APIs c. Quota Usage server enhancements d. Quota UI plugin e. Tests * pr/768: CLOUDSTACK-8592: Implement Quota service Signed-off-by: Remi Bergsma <[email protected]>
|
Built it again, turned feature on, still looks good. Merging! |
|
@abhinandanprateek @bhaisaab @jburwell Normal users / domain admins cannot login any more: |
|
checking. cc @remibergsma |
|
@bhaisaab Probably a icon with grey layer would be better to respect the UI Design? |
|
@milamberspace okay, sending a new PR for that |
Makes the quota ui plugin icon gray, based on comment at: apache#768 (comment) Signed-off-by: Rohit Yadav <[email protected]>
ui/quota: Make the quota UI plugin icon grayMakes the quota ui plugin icon gray, based on comment at: #768 (comment) * pr/1208: ui/quota: Make the quota UI plugin icon gray Signed-off-by: Remi Bergsma <[email protected]>
Fixes #766 For isolated networks, load balancing, port forwarding and firewall options are not displayed. For source nat ip of vpc, all options are displayed but it should not be Below are the expected actions according to legacy UI for isolated networks if static nat is disabled then display all options if static nat is enabled then display only firewall tab for VPC networks for source nat IP, dont display any option for other ip's firewall is always disabled. Load balancing and port forwarding options are mutually exclusive Co-authored-by: Rakesh Venkatesh <[email protected]> Signed-off-by: Rohit Yadav <[email protected]>


This pull request is for quota service implementation, divided into following commits:
Quota server side implementation
a. Quota Framework plugin containing Daos
b. Quota database plugin for quota APIs
c. Quota Usage server enhancements
d. Quota UI plugin
e. Tests