Is it possible to bypass the conventional DevStack `get_networks` functionality and use a custom built one?

asked 2020-01-15 08:08:23 -0500

The main idea is to bypass the functions get_networks, create_network, etc (at least the basic ones) that ml2 utilizes and use my own implementations to get/create this information

On my local project I have a get_networks function that can return the networks in JSON format through REST API and an endpoint that will call this function and provide the results. On a remote machine I have deployed a DevStack infrastructure and I want, when getting the networks through horizon UI, to receive the information of my endpoint, alongside with the local database that neutron keeps.

I have done something similar with cinder volumes successfully by editing the cinder.conf file with the line volume_driver = myproject.mydriver and with instances using compute_driver = myproject.mydriver but after a lot of research I have figured that neutron does not work like that and instead of a driver I have several agents/plugins/other ( I am still a newbie and have many gaps) and so I can not edit the neutron.conf file to do something similar. I tried replacing core_plugin = ml2 setting but to no avail.

Supposedly I could inject my call into .../neutron/plugins/ml2/plugin.py but I'd really prefer to leave the DevStack code as is.

So I am looking for a way to override, bypass, or extend the plugin though external file to utilize my own functionality. Any insight or correction to my misunderstandings is more than welcome.

edit retag flag offensive close merge delete

Comments

By get_networks, do you mean the API?

The terms "driver" and "plugin" are more or less interchangeable. You can write your own plugin, but the ML2 plugin is the canonical implementation of Neutron's core resources network, subnet and port; replacing it with your code would be a huge undertaking.

Bernd Bausch gravatar imageBernd Bausch ( 2020-01-15 16:09:31 -0500 )edit

Thanks for the reply, I understand the complications, and know that it might not work. I just can't figure out how to use my own plugin instead of ml2. Is there some piece that I can write on neutron.conf that will provide the path for the new plugin? If there is a guide about this somewhere?

Dimitris Giannopoulos gravatar imageDimitris Giannopoulos ( 2020-01-16 02:34:38 -0500 )edit

I don't know whether there is a guide for writing core plugins; perhaps in the developers corner of http://docs.openstack.org/neutron.

To configure an existing core plugin, the core_plugin setting is used.

Bernd Bausch gravatar imageBernd Bausch ( 2020-01-16 05:51:02 -0500 )edit
1

This is the most promising page, in my opinion: https://docs.openstack.org/neutron/la.... It includes a link to a presentation how to write a plug-in (old but probably still useful). Also search for the video of this presentation.

Bernd Bausch gravatar imageBernd Bausch ( 2020-01-16 19:55:13 -0500 )edit

I am looking into this presentation, looks promising, thanks

Dimitris Giannopoulos gravatar imageDimitris Giannopoulos ( 2020-01-17 10:25:09 -0500 )edit