How to create new ML2 mechanism driver [closed]
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 ...