Add new setting for SimpleTenantUsage
This introduces a new setting OPENSTACK_USE_SIMPLE_TENANT_USAGE as a replace of SimpleTenantUsage in OPENSTACK_NOVA_EXTENSIONS_BLACKLIST. We received feedbacks on the need to control whether SimpleTenantUsage is used or not, so we need a new setting before retiring OPENSTACK_NOVA_EXTENSIONS_BLACKLIST. Change-Id: Ib786ea2ac232fcd851f4b276b9144c14c0b62a0a
This commit is contained in:
parent
f90c3cd501
commit
c9e47d6595
@ -2347,6 +2347,18 @@ as nova provides all features in the recent API versions.
|
|||||||
* ``Services``
|
* ``Services``
|
||||||
* ``Shelve``
|
* ``Shelve``
|
||||||
|
|
||||||
|
OPENSTACK_USE_SIMPLE_TENANT_USAGE
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. versionadded:: 19.0.0(Wallaby)
|
||||||
|
|
||||||
|
Default: ``True``
|
||||||
|
|
||||||
|
This setting controls whether ``SimpleTenantUsage`` nova API is used in the
|
||||||
|
usage overview. According to feedbacks to the horizon team, the usage of
|
||||||
|
``SimpleTenantUsage`` can cause performance issues in the nova API in larger
|
||||||
|
deployments. Try to set this to ``False`` for such cases.
|
||||||
|
|
||||||
Swift
|
Swift
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -462,6 +462,13 @@ OPENSTACK_NEUTRON_NETWORK = {
|
|||||||
OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES = True
|
OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES = True
|
||||||
|
|
||||||
OPENSTACK_NOVA_EXTENSIONS_BLACKLIST = []
|
OPENSTACK_NOVA_EXTENSIONS_BLACKLIST = []
|
||||||
|
|
||||||
|
# This setting controls whether SimpleTenantUsage nova API is used in the usage
|
||||||
|
# overview. According to feedbacks to the horizon team, the usage of
|
||||||
|
# SimpleTenantUsage can cause performance issues in the nova API in larger
|
||||||
|
# deployments. Try to set this to ``False`` for such cases.
|
||||||
|
OPENSTACK_USE_SIMPLE_TENANT_USAGE = True
|
||||||
|
|
||||||
# The Xen Hypervisor has the ability to set the mount point for volumes
|
# The Xen Hypervisor has the ability to set the mount point for volumes
|
||||||
# attached to instances (other Hypervisors currently do not). Setting
|
# attached to instances (other Hypervisors currently do not). Setting
|
||||||
# can_set_mount_point to True will add the option to set the mount point
|
# can_set_mount_point to True will add the option to set the mount point
|
||||||
|
@ -112,7 +112,9 @@ class BaseUsage(object):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
def summarize(self, start, end):
|
def summarize(self, start, end):
|
||||||
if not api.nova.extension_supported('SimpleTenantUsage', self.request):
|
if not (settings.OPENSTACK_USE_SIMPLE_TENANT_USAGE and
|
||||||
|
api.nova.extension_supported('SimpleTenantUsage',
|
||||||
|
self.request)):
|
||||||
return
|
return
|
||||||
|
|
||||||
if start <= end and start <= self.today:
|
if start <= end and start <= self.today:
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.contrib.humanize.templatetags import humanize as humanize_filters
|
from django.contrib.humanize.templatetags import humanize as humanize_filters
|
||||||
from django.utils.translation import pgettext_lazy
|
from django.utils.translation import pgettext_lazy
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
@ -66,8 +67,10 @@ class UsageView(tables.DataTableView):
|
|||||||
context['usage'] = self.usage
|
context['usage'] = self.usage
|
||||||
|
|
||||||
try:
|
try:
|
||||||
context['simple_tenant_usage_enabled'] = \
|
context['simple_tenant_usage_enabled'] = (
|
||||||
|
settings.OPENSTACK_USE_SIMPLE_TENANT_USAGE and
|
||||||
api.nova.extension_supported('SimpleTenantUsage', self.request)
|
api.nova.extension_supported('SimpleTenantUsage', self.request)
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
context['simple_tenant_usage_enabled'] = True
|
context['simple_tenant_usage_enabled'] = True
|
||||||
return context
|
return context
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
A new setting ``OPENSTACK_USE_SIMPLE_TENANT_USAGE`` was introduced
|
||||||
|
as a replacement of ``SimpleTenantUsage`` in
|
||||||
|
the deprecated ``OPENSTACK_NOVA_EXTENSIONS_BLACKLIST`` setting.
|
||||||
|
This new setting controls whether ``SimpleTenantUsage`` nova API is used
|
||||||
|
in the usage overview. According to feedbacks to the horizon team,
|
||||||
|
the usage of ``SimpleTenantUsage`` can cause performance issues in the
|
||||||
|
nova API in larger deployments.
|
||||||
|
Try to set this to ``False`` for such cases.
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Considering the deprecation of ``OPENSTACK_NOVA_EXTENSIONS_BLACKLIST``,
|
||||||
|
set a new setting ``OPENSTACK_USE_SIMPLE_TENANT_USAGE`` to ``False``
|
||||||
|
if you specify ``SimpleTenantUsage`` in
|
||||||
|
``OPENSTACK_USE_SIMPLE_TENANT_USAGE``
|
Loading…
x
Reference in New Issue
Block a user