Ask Your Question
1

How to create new ML2 mechanism driver [closed]

asked 2014-05-22 02:34:44 -0600

Mio gravatar image

updated 2014-05-22 04:25:03 -0600

Hi there, im new to openstack and i want to create a ML2 driver for a controller.

I have googled and I havent seen any manual/documentation on how to creating ML2 drivers.

My current situation: I want to create a ML2 mechanism driver called xxx

Here is my plugin.ini:

[ml2]
# (ListOpt) List of network type driver entrypoints to be loaded from
# the neutron.ml2.type_drivers namespace.
#
# type_drivers = local,flat,vlan,gre,vxlan
# Example: type_drivers = flat,vlan,gre,vxlan
type_drivers = flat,vxlan

# (ListOpt) Ordered list of network_types to allocate as tenant
# networks. The default value 'local' is useful for single-box testing
# but provides no connectivity between hosts.
#
# tenant_network_types = local
# Example: tenant_network_types = vlan,gre,vxlan
tenant_network_types = flat,vxlan

# (ListOpt) Ordered list of networking mechanism driver entrypoints
# to be loaded from the neutron.ml2.mechanism_drivers namespace.
# mechanism_drivers = openvswitch
# Example: mechanism drivers = openvswitch,mlnx
# Example: mechanism_drivers = arista
# Example: mechanism_drivers = cisco,logger
# Example: mechanism_drivers = openvswitch,brocade
# Example: mechanism_drivers = linuxbridge,brocade
mechanism_drivers = xxx

I have created python module for my driver called mechanism_xxx.py in the location below which I patterned it with OpenDaylight mechanism driver:

/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers

The contents of the file:

from neutron.plugins.ml2 import driver_api as api

class XxxMechanismDriver(api.MechanismDriver):

    def initialize(self):
        pass

    def create_network_postcommit(self, context):
        pass

    def update_network_postcommit(self, context):
        pass

    def delete_network_postcommit(self, context):
        pass

...

After starting the neutron-server service, it cannot find the xxx driver. Here are the logs:

2014-05-22 14:38:49.028 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('hyperv = neutron.plugins.ml2.drivers.mech_hyperv:HypervMechanismDriver') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:162
2014-05-22 14:38:49.028 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('l2population = neutron.plugins.ml2.drivers.l2pop.mech_driver:L2populationMechanismDriver') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:162
2014-05-22 14:38:49.028 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('ofagent = neutron.plugins.ml2.drivers.mech_ofagent:OfagentMechanismDriver') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:162
2014-05-22 14:38:49.028 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('ncs = neutron.plugins.ml2.drivers.mechanism_ncs:NCSMechanismDriver') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:162
2014-05-22 14:38:49.028 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('cisco_nexus = neutron.plugins.ml2.drivers.cisco.nexus.mech_cisco_nexus:CiscoNexusMechanismDriver') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:162
2014-05-22 14:38:49.028 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('openvswitch = 

...

2014-05-22 14:38:49.029 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('opendaylight = neutron.plugins.ml2.drivers.mechanism_odl:OpenDaylightMechanismDriver') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:162
2014-05-22 14:38:49.029 55872 DEBUG stevedore.extension [-] found extension EntryPoint.parse('bulkless = neutron.tests.unit.ml2.drivers.mechanism_bulkless:BulklessMechanismDriver') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:162
2014-05-22 14:38:49.029 55872 DEBUG neutron.openstack.common.lockutils [-] Semaphore / lock released "_create_instance" inner /usr/lib/python2.7/site-packages/neutron/openstack/common/lockutils.py:252
2014-05-22 14:38 ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Mio
close date 2014-05-27 23:10:07.508062

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-05-22 13:11:43 -0600

smaffulli gravatar image

I suggest you to start hanging out on https://wiki.openstack.org/wiki/IRC to get some guidance from Neutron developers.

edit flag offensive delete link more
1

answered 2014-05-22 14:12:52 -0600

darragh-oreilly gravatar image

Have a look at how the OpenDayLight mechanism driver was done. I reckon you will need to add something to setup.cfg to relate the driver name to its class.

edit flag offensive delete link more

Comments

I don't know. Normally development is not done on a deployed environment.

darragh-oreilly gravatar imagedarragh-oreilly ( 2014-05-27 05:48:06 -0600 )edit

I dont find setup.cfg in the Icehouse installation?.. Should i have to create one manually by myself?... If so, where it should me ie, path?

Vad gravatar imageVad ( 2014-09-10 10:43:20 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2014-05-22 02:34:44 -0600

Seen: 1,828 times

Last updated: May 22 '14