Revision history [back]

click to hide/show revision 1
initial version

quantum plugin floating_ip api error

I am using devstack single node installation with quantum enabled for my openstack learning and quantum plugin development. For the start, I am just trying to create a plugin that calls back openvswitch plugin. Created new plugin folder under stack/quantum/quantum/plugins and added __init__.py and TestPlugin.py files. Created new plugin folder under stack/quantum/etc/quantum/plugins/ and then copied ovs_quantum_plugin.ini and renamed to TestPlugin.ini. Created new file under devstack/lib/quantum_plugins and copied contents of openvswitch file and made changes in it to point my plugin and ini. Changed localtrc to use my plugin.

UnStacked and restacked. But when I try to login it is failing in floating_ips rest call! If I just commentout my plugin in localrc(switching to ovs) then everything works fine.

Pasted my plugin and locarc contents at the bottom. Here is the error:

Environment: Request Method: GET Request URL: http://172.16.4.190/project/

Django Version: 1.4.5 Python Version: 2.7.3 Installed Applications: ['openstack_dashboard', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'compressor', 'horizon', 'openstack_dashboard.dashboards.project', 'openstack_dashboard.dashboards.admin', 'openstack_dashboard.dashboards.settings', 'openstack_auth'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'horizon.middleware.HorizonMiddleware', 'django.middleware.doc.XViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, callback_args, *callback_kwargs) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec 38. return view_func(request, args, *kwargs) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec 54. return view_func(request, args, *kwargs) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec 38. return view_func(request, args, *kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view 48. return self.dispatch(request, args, *kwargs) File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch 69. return handler(request, args, *kwargs) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in get 155. handled = self.construct_tables() File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in construct_tables 146. handled = self.handle_table(table) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in handle_table 118. data = self._get_data_dict() File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in _get_data_dict 182. self._data = {self.table_class._meta.name: self.get_data()} File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/overview/views.py" in get_data 32. super(ProjectOverview, self).get_data() File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/views.py" in get_data 34. self.usage.get_quotas() File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/base.py" in get_quotas 115. _("Unable to retrieve quota information.")) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/base.py" in get_quotas 112. self.quotas = quotas.tenant_quota_usages(self.request) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/utils/memoized.py" in __call__ 33. value = self.func(args) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/quotas.py" in tenant_quota_usages 88. floating_ips = network.tenant_floating_ip_list(request) File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/network.py" in tenant_floating_ip_list 141. return NetworkClient(request).floating_ips.list() File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/quantum.py" in list 125. fips = self.client.list_floatingips().get('floatingips') File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in with_params 107. ret = self.function(instance, *args, *kwargs) File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in list_floatingips 434. *_params) File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in list 996. for r in self._pagination(collection, path, *params): File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in _pagination 1009. res = self.get(path, params=params) File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in get 982. headers=headers, params=params) File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in retry_request 967. headers=headers, params=params) File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in do_request 912. self._handle_fault_response(status_code, replybody) File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in _handle_fault_response 893. exception_handler_v20(status_code, des_error_body) File "/opt/stack/python-quantumclient/quantumclient/v2_0/client.py" in exception_handler_v20 87. message=message)

Exception Type: QuantumClientException at /project/ Exception Value: 404 Not Found

The resource could not be found.

...... My plugin:

import logging

import ConfigParser

from quantum.db import db_base_plugin_v2 from quantum.db import l3_db from quantum.db import api as db from quantum.db import models_v2 from quantum.api.v2 import attributes from quantum.common.utils import find_config_file from quantum.common import exceptions as q_exc from quantum.openstack.common import cfg

from quantum.plugins.openvswitch.ovs_quantum_plugin import OVSQuantumPluginV2 as OVS_plugin LOG = logging.getLogger(__name__)

class TestPlugin(db_base_plugin_v2.QuantumDbPluginV2, l3_db.L3_NAT_db_mixin):

def __init__(self):
    self.ovsint = OVS_plugin()


def create_network(self, context, network):
    return self.ovsint.create_network(context, network)

def update_network(self, context, id, network):
    return self.ovsint.update_network(context, id, network)

def get_network(self, context, id, fields=None):
    return self.ovsint.get_network(context, id, fields)

def get_networks(self, context, filters=None, fields=None):
    return self.ovsint.get_networks(context, filters,fields)

def delete_network(self, context, id):
    self.ovsint.delete_network(context, id)

def create_port(self, context, port):
    return self.ovsint.create_port(context, port)

def update_port(self, context, id, port):
    return self.ovsint.update_port(context,id, port)

def get_port(self, context, id, fields=None):
    return self.ovsint.get_port(context,id,fields)

def get_ports(self, context, filters=None, fields=None):
    return self.ovsint.get_ports(context, filters, fields)

def delete_port(self, context, id, l3_port_check=True):
    return self.ovsint.delete_port(context, id, l3_port_check)

.......

My localrc:

disable_service n-net enable_service q-svc enable_service q-agt enable_service q-dhcp enable_service q-l3 enable_service q-meta enable_service quantum

Q_PLUGIN=TestPlugin