How to write l3-Plugin?

Asked by Sachin Patil

Hi All,

I have gone through lot of docs about quantum plugin and did not get clear idea about the plugin.
I want to extend routing functionality by adding virtual router to openstack. What is the best way to do this?

I am confused between l2 and l3 plugin. Also want to understand what l3-agent and plugin-agent does.

 If the plugin(that I need to write) just implements l3 functionlity, then who is going to provide l2 functionlity? Would there be other plugin that will do the l2 job like OpenViewSwitch?
If yes, is there way to run/configure two plugins simultaneously.
If no, then do I need to implement all the l2 and l3 functionality in my plugin and how can I implement it?

Please guide me!

Thanks in advance,
Sachin.

Question information

Language:
English Edit question
Status:
Answered
For:
neutron Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
yong sheng gong (gongysh) said :
#1

We have already a virtual router in neutron.
following are the commands of neutron client:
router-create router-interface-add router-port-list
router-delete router-interface-delete router-show
router-gateway-clear router-list router-update
router-gateway-set router-list-on-l3-agent

and please have a look at https://github.com/openstack/quantum/blob/master/quantum/plugins/openvswitch/ovs_quantum_plugin.py

in which, we have:
class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
                         extraroute_db.ExtraRoute_db_mixin,
                         l3_gwmode_db.L3_NAT_db_mixin,
                         sg_db_rpc.SecurityGroupServerRpcMixin,
                         agentschedulers_db.AgentSchedulerDbMixin,
                         portbindings_db.PortBindingMixin):

l3_gwmode_db.L3_NAT_db_mixin is our virtual router.

in addition please see our admin guide

Revision history for this message
Sachin Patil (cse-patilsachin) said :
#2

Hi yong,

Thank you for the reply.

I want to integrate third party virtual router / appliance with openstack neutron.

Please tell me how I can do this.

Thank You,
Sachin.

Revision history for this message
yong sheng gong (gongysh) said :
#3

1. you can implement an agent like l3_agent to communicate with neutron server and your third party virtual router / appliance
or,
2. you can write a plugin simulating the OVSQuantumPluginV2 to control your third party virtual router / appliance

Revision history for this message
Sachin Patil (cse-patilsachin) said :
#4

Hi Yong,

Thanks you very much for the reply again.

I will study the l3_agent functionality as well as OVSQuantumPluginV2.

If you can point me to some good docs, it will be very helpful for me.

Revision history for this message
Arun Sharma (arunain) said :
#5

In coming future,

1) Migrate L3 router service from mixin to plugin. (Note: this gives enough overview on what you are trying to achive)
https://blueprints.launchpad.net/neutron/+spec/quantum-l3-routing-plugin
MUST READ DOCUMENT - https://wiki.openstack.org/wiki/L3_mixin_to_plugin

2) To achieve above requirement, this blueprint is found which says "API framework for loading multiple service plugin". This is an Advanced service framework as part of Quantum.
Advanced services framework should allow implementation of additional services to be independent and decoupled from core plugins.
https://blueprints.launchpad.net/neutron/+spec/quantum-service-framework
This means, separate independent of L2, routing , Firewall, LbaaS plugin can also be developed separately in future and can be integrated.
There will be service_plugins option in quantum.conf to load different plugins instead of today having single option core_plugin in quantum.conf.
MUST READ DOCUMENT - https://wiki.openstack.org/wiki/Quantum/ServiceIntegration

3) Openvswitch plugin has to be modified so that it does not provide L3 functionality.
The L3 plugin is specified by the ‘service_plugins’ setting in ‘quantum.conf’ and the l3 agent is configured in the usual way in the ‘l3agent.ini’ file.

Excerpt from quantum.conf:

core_plugin =
quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
service_plugins =
quantum.plugins.services.l3_router.l3_router_plugin.L3RouterPlugin

Additional info
http://lists.openstack.org/pipermail/openstack-dev/2012-November/002582.html

Revision history for this message
Allister Maguire (allister-m) said :
#6

Hi

I have been following this question as I am keen on replacing the builtin virtual router functionality with an external solution using F5 Big-IP hardware.

Because I am not technically adding any functionality over and above what is already available with the virtual routers or floating IP's etc, the easiest way I see until Havana is released anyway is just rewriting the L3_agent functions to modify the F5 instead of iptables etc? I am assuming that is how it hangs together? F5 have a python module which makes it seem all relatively straightforward.

I would have to add some functionality to the agent to handle IP addressing for the hardware devices and using Route-Domain in place of namespaces, and remove the metadata-agent dependancy.

Thanks
Allister

Can you help with this problem?

Provide an answer of your own, or ask Sachin Patil for more information if necessary.

To post a message you must log in.