64 Commits

Author SHA1 Message Date
Remi Bergsma
8f5a2920e8 Updating pom.xml version numbers for release 4.8.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-21 22:09:31 +01:00
Abhinandan Prateek
983dee7f20 CLOUDSTACK-9174: A deleted account results in NPE
When an account is deleted from cloudstack for which quota is still
being calculated and if the quota reaches minimum threshold then
quota service will try to alert the user. This results in NPE and is
fixed by excluding such accounts from alerting and other quota related
mechanisms.

Quota service: Fix check for admin account
2015-12-18 08:52:16 +05:30
Abhinandan Prateek
ccd0f22061 CLOUDSTACK-9161: fix the quota marvin test
1. Create a dummy user, as existing user may already have stale quota
  data
  2. fix the tests to use the dummy user
  3. a boundary condition was revealed and fixed for a new user where
  quota service has never run and created bootstrap entries

Quota Marvin: If the quota plugin is not enabled skip tests

Quota Service: Enable quota plugin in zone setup configuration

Quota: Moving test_quota.py the test to test/integration/plugins
    In most automated environment this test case will not run as it
    requires a mangement server restart to enable the plugin. Due to
    this requirement moving it to plugin folder. This condition is
    already documented in the test case.
2015-12-16 16:22:31 +05:30
Remi Bergsma
7c83e1b240 Merge pull request #1205 from shapeblue/master-9126
QUOTA: Ensuring that the dates displayed are as per user expectations    When querying db we use start of next day to query quota usage for
    today, but while displaying it to user we still need to show it as
    todays date

* pr/1205:
  QUOTA: Ensuring that the dates displayed are as per user expectations

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-13 21:08:10 +01:00
Abhinandan Prateek
5025011d31 CLOUDSTACK-9153: When negative credits are added to an account the
balance credits can become negative for that account. This will fix will
lock the account if quota is enforced.
2015-12-13 09:28:02 +05:30
Abhinandan Prateek
1e17c3e38c QUOTA: Ensuring that the dates displayed are as per user expectations
When querying db we use start of next day to query quota usage for
    today, but while displaying it to user we still need to show it as
    todays date
2015-12-11 14:53:51 +05:30
Abhinandan Prateek
3e22fbe457 CLOUDSTACK-9131: Create a new API to check if the plugin is enabled.
fixing type
2015-12-10 09:37:54 +05:30
Abhinandan Prateek
987fcbd441 CLOUDSTACK-8592: Implement Quota service
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: https://github.com/apache/cloudstack/pull/768

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-12-07 23:02:48 +05:30
Remi Bergsma
1f53f2a93e Updating pom.xml version numbers for release 4.7.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-15 18:54:13 +01:00
Daan Hoogland
e2b6237464 CLOUDSTACK-8656: debug messages on interupted exceptions 2015-07-30 16:03:10 +02:00
Hugo Trippaers
4ebaf0a583 Bump master version to 4.6.0-SNAPSHOT after branching 4.5.0-SNAPSHOT 2014-10-29 14:54:23 +01:00
Hugo Trippaers
15b6860c68 Fix pom relative path 2014-03-14 14:55:26 +01:00
Hugo Trippaers
4402685e11 Update master to 4.5.0-SNAPSHOT 2014-03-14 14:55:26 +01:00
Hugo Trippaers
a0f932437c Move mysql ha strategy to a plugin. Activate this plugin using the mysqlha profile or the noredist flag 2014-02-27 09:51:02 +01:00