From c5fdc088493622a3a8ebfb38c6311bb4ef836477 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 5 Aug 2019 20:55:41 +0200 Subject: Allow turning off max_stacks limit The limit of 100 is fairly low for a normal production environment. Allow setting the limit to -1 to turn it off. Also raise limit to 512 which should be a bit more reasonable as a default. Change-Id: I9e54b20437875ed88b79414aa4fc17b17cbd305b Related-Bug: #1221849 --- heat/common/config.py | 6 +++--- heat/engine/service.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/heat/common/config.py b/heat/common/config.py index 6f389b374..1e38247a5 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -139,9 +139,9 @@ engine_opts = [ help=_('Maximum resources allowed per top-level stack. ' '-1 stands for unlimited.')), cfg.IntOpt('max_stacks_per_tenant', - default=100, - help=_('Maximum number of stacks any one tenant may have' - ' active at one time.')), + default=512, + help=_('Maximum number of stacks any one tenant may have ' + 'active at one time. -1 stands for unlimited.')), cfg.IntOpt('action_retry_limit', default=5, help=_('Number of times to retry to bring a ' diff --git a/heat/engine/service.py b/heat/engine/service.py index 38ee7291b..a0e607aea 100644 --- a/heat/engine/service.py +++ b/heat/engine/service.py @@ -680,7 +680,8 @@ class EngineService(service.ServiceBase): # Do not stack limit check for admin since admin can see all stacks. if not cnxt.is_admin: tenant_limit = cfg.CONF.max_stacks_per_tenant - if stack_object.Stack.count_all(cnxt) >= tenant_limit: + if (tenant_limit >= 0 and + stack_object.Stack.count_all(cnxt) >= tenant_limit): message = _("You have reached the maximum stacks per tenant, " "%d. Please delete some stacks.") % tenant_limit raise exception.RequestLimitExceeded(message=message) -- cgit v1.2.1