[PATCH] BZ 796695 enforce provider quota for multi instance deployments

Scott Seago sseago at redhat.com
Wed Feb 29 16:10:09 UTC 2012


On 02/29/2012 11:00 AM, Tzu-Mainn Chen wrote:
> ---
>   src/app/models/deployment.rb |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
> index ec66fdb..aa4e870 100644
> --- a/src/app/models/deployment.rb
> +++ b/src/app/models/deployment.rb
> @@ -376,6 +376,10 @@ class Deployment<  ActiveRecord::Base
>         deployment_errors = []
>         deployment_errors<<  I18n.t('instances.errors.pool_quota_reached') if not pool.quota.can_start?(instances)
>         deployment_errors<<  I18n.t('instances.errors.pool_family_quota_reached') if not pool.pool_family.quota.can_start?(instances)
> +      pool.pool_family.provider_accounts.each do |account|
> +        deployment_errors<<  I18n.t('instances.errors.provider_account_quota_reached', :account_name =>  account.name) if not account.quota.can_start?(instances)
> +      end
> +
>         if not deployment_errors.empty?
>           raise Aeolus::Conductor::MultiError::UnlaunchableAssembly.new(I18n.t('deployments.flash.error.not_launched'), deployment_errors)
>         end
Hmm, this doesn't seem right.

This will throw an error if _any_ provider account has reached quota. 
Really hitting quota on one account just means we should use another. 
Provider account quota violations should result in filtering the 
provider account out of the mix when matching (we're already doing this 
-- you may just need to alter it to work w/ multi-instance deployments)

NACK

Scott




More information about the aeolus-devel mailing list