Bug 1243301 - nova API cannot allocate memory due to horizon os-simple-tenant-usage calls
Summary: nova API cannot allocate memory due to horizon os-simple-tenant-usage calls
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-horizon
Version: 6.0 (Juno)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 6.0 (Juno)
Assignee: Matthias Runge
QA Contact: Ido Ovadia
URL:
Whiteboard:
Depends On:
Blocks: 1244106
TreeView+ depends on / blocked
 
Reported: 2015-07-15 07:25 UTC by Martin Schuppert
Modified: 2023-02-22 23:02 UTC (History)
9 users (show)

Fixed In Version: python-django-horizon-2014.2.3-6.1.el7ost
Doc Type: Bug Fix
Doc Text:
Cause: The Nova API call to get the simple tenant usage data is currently very costly in terms of memory used. Repeated calls may cause out of memory errors, especially when there are a lot of deleted nodes in the database. Consequence: Nova crashes with "out of memory" error. Workaround: Disable displaying of the simple tenant usage statistics on the Horizon side, by blacklisting the nova extension using the following configuration: OPENSTACK_NOVA_EXTENSIONS_BLACKLIST = ["SimpleTenantUsage"] Result: The simple tenant usage statistics will no longer be displayed in Horizon.
Clone Of:
: 1244106 (view as bug list)
Environment:
Last Closed: 2015-08-24 20:16:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1474241 0 None None None Never
OpenStack gerrit 201221 0 None None None Never
Red Hat Issue Tracker OSP-16646 0 None None None 2022-07-09 07:46:03 UTC
Red Hat Knowledge Base (Solution) 1530763 0 None None None Never
Red Hat Product Errata RHSA-2015:1679 0 normal SHIPPED_LIVE Moderate: python-django-horizon security and bug fix update 2015-08-25 00:15:52 UTC

Description Martin Schuppert 2015-07-15 07:25:29 UTC
Description of problem:

When logging into horizon, horizon sends an API request to nova inquiring about usage statistics.
Among the api requests is os-simple-tenant-usage. We see that, if there are thousands of deleted VMs in the nova DB, this api call makes the nova-api process memory consumption skyrocket. If there are enough deleted VMs in the DB the nova-api eventually crashes due to lack of memory.

I was able to reproduce this in a lab setup (by running a script that creates many VMs and then deletes them continuously). I was also able to make the problem go away by deleting the VM entries from the nova database. 

Version-Release number of selected component (if applicable):
OSP6 

Proposed fix - https://review.openstack.org/#/c/201221/

~~~
Add an OPENSTACK_SIMPLE_TENANT_USAGE_ENABLED settings option


The users may want to disable the simple tenant usage display for
efficiency reasons -- currently this gets very slow and may run out of
memory if there are a lot of deleted machines in the Nova database.

In the 2.0 API we can disable it on the Nova side, but it won't be
possible anymore with the 2.1 API.
~~~



Additional info:
related to BZ1154237

Comment 2 Radomir Dopieralski 2015-07-15 08:16:58 UTC
We came up with a more generic solution:

~~~
Add OPENSTACK_NOVA_EXTENSIONS_BLACKLIST option to settings

This lets us disable any Nova extension we like, not just the
simple tenant usage.
~~~

Comment 10 Radomir Dopieralski 2015-08-14 07:14:29 UTC
The patch has been merged upstream.

Comment 12 Ido Ovadia 2015-08-19 15:01:33 UTC
Verified
========
openstack-dashboard-2014.2.3-6.1.el7ost.noarch
python-django-horizon-2014.2.3-6.1.el7ost.noarch

Comment 14 errata-xmlrpc 2015-08-24 20:16:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1679.html


Note You need to log in before you can comment on or make changes to this bug.