[openstack-dev] [Openstack] Writing Plug-ins to Quantum
gong yong sheng
gongysh at linux.vnet.ibm.com
Wed Oct 31 09:18:03 UTC 2012
On 10/31/2012 05:00 PM, Trinath Somanchi wrote:
> Hi Stackers-
>
> I'm testing a dummy plugin which does and RPC based communication with
> Quantum.
>
> I have done this following:
>
> [1] I have written dummy agent like DHCP agent - Present in HOST
> [2] I have written dummy_rpc_base like the db/dhcp_rpc_base.py -
> Present in Controller
> [3] I have written an testing method to the db/db_base_plugin_v2.py
> - Present in Controller
>
> But when I restart the quantum-server, I get this error:
>
> root at user-P2020Build:/usr/lib/python2.7/dist-packages/quantum/db#
> python /usr/bin/quantum-server -- --config-file
> /etc/quantum/quantum.conf --log-file /var/log/quantum/server.log
> --config-file /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini
> 2012-10-31 14:20:30 DEBUG [quantum.service]
> ********************************************************************************
> 2012-10-31 14:20:30 DEBUG [quantum.service] Configuration options
> gathered from config file:
> 2012-10-31 14:20:30 DEBUG [quantum.service]
> ================================================
> 2012-10-31 14:20:30 DEBUG [quantum.service] allow_bulk
> True
> 2012-10-31 14:20:30 DEBUG [quantum.service] allow_overlapping_ips
> False
> 2012-10-31 14:20:30 DEBUG [quantum.service] api_extensions_path
> 2012-10-31 14:20:30 DEBUG [quantum.service] api_paste_config
> /etc/quantum/api-paste.ini
> 2012-10-31 14:20:30 DEBUG [quantum.service] auth_strategy
> keystone
> 2012-10-31 14:20:30 DEBUG [quantum.service] base_mac
> fa:16:3e:00:00:00
> 2012-10-31 14:20:30 DEBUG [quantum.service] bind_host
> 0.0.0.0
> 2012-10-31 14:20:30 DEBUG [quantum.service] bind_port
> 9696
> 2012-10-31 14:20:30 DEBUG [quantum.service] config_dir
> None
> 2012-10-31 14:20:30 DEBUG [quantum.service] config_file
> ['/etc/quantum/quantum.conf']
> 2012-10-31 14:20:30 DEBUG [quantum.service] core_plugin
> quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
> 2012-10-31 14:20:30 DEBUG [quantum.service] debug
> True
> 2012-10-31 14:20:30 DEBUG [quantum.service] dhcp_lease_duration
> 120
> 2012-10-31 14:20:30 DEBUG [quantum.service] log_config
> None
> 2012-10-31 14:20:30 DEBUG [quantum.service] log_date_format
> %Y-%m-%d %H:%M:%S
> 2012-10-31 14:20:30 DEBUG [quantum.service] log_dir
> None
> 2012-10-31 14:20:30 DEBUG [quantum.service] log_file
> None
> 2012-10-31 14:20:30 DEBUG [quantum.service] log_format
> %(asctime)s %(levelname)8s [%(name)s] %(message)s
> 2012-10-31 14:20:30 DEBUG [quantum.service] mac_generation_retries
> 16
> 2012-10-31 14:20:30 DEBUG [quantum.service] max_dns_nameservers
> 5
> 2012-10-31 14:20:30 DEBUG [quantum.service] max_subnet_host_routes
> 20
> 2012-10-31 14:20:30 DEBUG [quantum.service] policy_file
> policy.json
> 2012-10-31 14:20:30 DEBUG [quantum.service] state_path
> .
> 2012-10-31 14:20:30 DEBUG [quantum.service] syslog_log_facility
> LOG_USER
> 2012-10-31 14:20:30 DEBUG [quantum.service] use_syslog
> False
> 2012-10-31 14:20:30 DEBUG [quantum.service] verbose
> True
> 2012-10-31 14:20:30 DEBUG [quantum.service]
> ********************************************************************************
> 2012-10-31 14:20:30 INFO [quantum.common.config] Config paste
> file: /etc/quantum/api-paste.ini
> 2012-10-31 14:20:30 DEBUG [quantum.manager] Plugin
> location:quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
> 2012-10-31 14:20:30 INFO [quantum.manager] Loading Plugin:
> quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
> Traceback (most recent call last):
> File "/usr/bin/quantum-server", line 26, in <module>
> server()
> File "/usr/lib/python2.7/dist-packages/quantum/server/__init__.py",
> line 40, in main
> quantum_service = service.serve_wsgi(service.QuantumApiService)
> File "/usr/lib/python2.7/dist-packages/quantum/service.py", line 83,
> in serve_wsgi
> service.start()
> File "/usr/lib/python2.7/dist-packages/quantum/service.py", line 42,
> in start
> self.wsgi_app = _run_wsgi(self.app_name)
> File "/usr/lib/python2.7/dist-packages/quantum/service.py", line 89,
> in _run_wsgi
> app = config.load_paste_app(app_name)
> File "/usr/lib/python2.7/dist-packages/quantum/common/config.py",
> line 133, in load_paste_app
> app = deploy.loadapp("config:%s" % config_path, name=app_name)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 247, in loadapp
> return loadobj(APP, uri, name=name, **kw)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 272, in loadobj
> return context.create()
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 710, in create
> return self.object_type.invoke(self)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 144, in invoke
> **context.local_conf)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line
> 59, in fix_call
> reraise(*exc_info)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/compat.py", line
> 22, in reraise
> exec('raise t, e, tb', dict(t=t, e=e, tb=tb))
> File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line
> 56, in fix_call
> val = callable(*args, **kw)
> File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 25, in
> urlmap_factory
> app = loader.get_app(app_name, global_conf=global_conf)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 350, in get_app
> name=name, global_conf=global_conf).create()
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 710, in create
> return self.object_type.invoke(self)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 144, in invoke
> **context.local_conf)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line
> 59, in fix_call
> reraise(*exc_info)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/compat.py", line
> 22, in reraise
> exec('raise t, e, tb', dict(t=t, e=e, tb=tb))
> File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line
> 56, in fix_call
> val = callable(*args, **kw)
> File "/usr/lib/python2.7/dist-packages/quantum/auth.py", line 61, in
> pipeline_factory
> app = loader.get_app(pipeline[-1])
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 350, in get_app
> name=name, global_conf=global_conf).create()
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 710, in create
> return self.object_type.invoke(self)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py",
> line 146, in invoke
> return fix_call(context.object, context.global_conf,
> **context.local_conf)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line
> 59, in fix_call
> reraise(*exc_info)
> File "/usr/lib/python2.7/dist-packages/paste/deploy/compat.py", line
> 22, in reraise
> exec('raise t, e, tb', dict(t=t, e=e, tb=tb))
> File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line
> 56, in fix_call
> val = callable(*args, **kw)
> File "/usr/lib/python2.7/dist-packages/quantum/api/v2/router.py",
> line 67, in factory
> return cls(**local_config)
> File "/usr/lib/python2.7/dist-packages/quantum/api/v2/router.py",
> line 71, in __init__
> plugin = manager.QuantumManager.get_plugin()
> File "/usr/lib/python2.7/dist-packages/quantum/manager.py", line 65,
> in get_plugin
> cls._instance = cls()
> File "/usr/lib/python2.7/dist-packages/quantum/manager.py", line 54,
> in __init__
> plugin_klass = importutils.import_class(plugin_provider)
> File
> "/usr/lib/python2.7/dist-packages/quantum/openstack/common/importutils.py",
> line 30, in import_class
> __import__(mod_str)
> File
> "/usr/lib/python2.7/dist-packages/quantum/plugins/openvswitch/ovs_quantum_plugin.py",
> line 33, in <module>
> from quantum.db import l3_db
> File "/usr/lib/python2.7/dist-packages/quantum/db/l3_db.py", line
> 86, in <module>
> class L3_NAT_db_mixin(l3.RouterPluginBase):
> File "/usr/lib/python2.7/dist-packages/quantum/db/l3_db.py", line
> 111, in L3_NAT_db_mixin
> _network_filter_hook)
> TypeError: unbound method register_model_query_hook() must be called
> with QuantumDbPluginV2 instance as first argument (got DeclarativeMeta
> instance instead)
>
> How to resolve this error?
>
I don't know what change you have done to the code, so cannot help a lot.
> How can I register a new plugin/agent with the quantum?
>
quantum.conf define the plugin:
core_plugin =
quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
You can point it to your plugin.
plugin agent is a peer for the plugin, that is running standalone.
> Please help me in this regard.
>
>
> --
> Regards,
> ----------------------------------------------
> Trinath Somanchi,
> +91 9866 235 130
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~openstack
> More help : https://help.launchpad.net/ListHelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121031/b0a7ea4e/attachment.html>
More information about the OpenStack-dev
mailing list