diff --git a/install.sh b/install.sh index 81f19d63f9..cc96a91aa2 100755 --- a/install.sh +++ b/install.sh @@ -228,6 +228,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/auth/ssh \ $VAR_LOCATION/remotes/auth/x509 \ $VAR_LOCATION/remotes/auth/server \ + $VAR_LOCATION/remotes/auth/quota \ $VAR_LOCATION/remotes/auth/dummy" SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \ @@ -325,6 +326,7 @@ INSTALL_FILES=( AUTH_SERVER_FILES:$VAR_LOCATION/remotes/auth/server AUTH_DUMMY_FILES:$VAR_LOCATION/remotes/auth/dummy AUTH_PLAIN_FILES:$VAR_LOCATION/remotes/auth/plain + AUTH_QUOTA_FILES:$VAR_LOCATION/remotes/auth/quota VMM_EXEC_KVM_SCRIPTS:$VAR_LOCATION/remotes/vmm/kvm VMM_EXEC_XEN_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen VMM_EXEC_XEN_KVM_POLL:$VAR_LOCATION/remotes/vmm/kvm/poll @@ -466,6 +468,7 @@ BIN_FILES="src/nebula/oned \ src/cli/onetemplate \ src/cli/oneacl \ src/onedb/onedb \ + src/authm_mad/remotes/quota/onequota \ share/scripts/one" #------------------------------------------------------------------------------- @@ -489,6 +492,7 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \ src/oca/ruby/OpenNebula.rb \ src/tm_mad/TMScript.rb \ src/authm_mad/remotes/ssh/ssh_auth.rb \ + src/authm_mad/remotes/quota/quota.rb \ src/authm_mad/remotes/server/server_auth.rb \ src/authm_mad/remotes/x509/x509_auth.rb" @@ -595,6 +599,8 @@ AUTH_DUMMY_FILES="src/authm_mad/remotes/dummy/authenticate" AUTH_PLAIN_FILES="src/authm_mad/remotes/plain/authenticate" +AUTH_QUOTA_FILES="src/authm_mad/remotes/quota/authorize" + #------------------------------------------------------------------------------- # Transfer Manager commands, to be installed under $LIB_LOCATION/tm_commands # - NFS TM, $LIB_LOCATION/tm_commands/nfs @@ -707,6 +713,7 @@ HM_ETC_FILES="src/hm_mad/hmrc" #------------------------------------------------------------------------------- AUTH_ETC_FILES="src/authm_mad/remotes/server/server_auth.conf \ + src/authm_mad/remotes/quota/quota.conf \ src/authm_mad/remotes/x509/x509_auth.conf" #------------------------------------------------------------------------------- diff --git a/src/authm_mad/remotes/quota/quota.conf b/src/authm_mad/remotes/quota/quota.conf index 5ada4f7f9b..d0fb458b5b 100644 --- a/src/authm_mad/remotes/quota/quota.conf +++ b/src/authm_mad/remotes/quota/quota.conf @@ -18,10 +18,23 @@ #:db: sqlite:///var/one/onequota.db #------------------------------------------------------------------------------- -# Default quotas +# Default quotas, these apply to all users. Leave empty to disable quota for +# a given metric. #------------------------------------------------------------------------------- :defaults: :cpu: :memory: :num_vms: :storage: + +# Set quotas per user for the desired metrics. If not defined default will be +# used. Set an empty quota to disable the metric +# +# Examples: +# "User 3 can run at most 10 VMs using 4GB overall at most without limit on +# the cpu requested." +# +#:3: +# :cpu: +# :memory:4096 +# :num_vms:10 diff --git a/src/authm_mad/remotes/quota/quota.rb b/src/authm_mad/remotes/quota/quota.rb index 19525804db..a32232ef83 100644 --- a/src/authm_mad/remotes/quota/quota.rb +++ b/src/authm_mad/remotes/quota/quota.rb @@ -32,7 +32,7 @@ class Quota ETC_LOCATION = ONE_LOCATION + "/etc" end - CONF_FILE = ETC_LOCATION + "/quota.conf" + CONF_FILE = ETC_LOCATION + "/auth/quota.conf" CONF = { :db => "sqlite://#{VAR_LOCATION}/onequota.db",