[openstack-dev] [neutron] Creating database model and agent

Doug Wiegley dougw at a10networks.com
Fri Aug 1 17:31:02 UTC 2014

If it helps as a reference, these three reviews by Brandon Logan are
adding exactly what you're talking about for the new LBaaS api.  Models,
migration, extension, plugin, unit tests:

* New extension for version 2 of LBaaS API -
* Plugin/DB additions for version 2 of LBaaS API -
* Tests for extension, db and plugin for LBaaS V2 -

And I don't believe there's anything extra in neutron for a new agent,
though I'm not 100% certain about that.



On 8/1/14, 3:14 AM, "Maciej Nabożny" <mn at mnabozny.pl> wrote:

>some days ago I was asking you about creating extension and service
>plugin for Neutron. Now, I am trying to find how to create database
>model for this plugin and agent :)
>Could you check if I am understanding this issues properly?
>The database model for new plugin should be created in neutron/db
>directory. The model classes should inherit:
>1. neutron.db.model_base.BASEV2, which is related to NeutronBaseV2 class
>2. if model should contain id or relation to tenant, it should inherit
>also HasTenant and HasId from module neutron.db.models_v2
>3. All other fields should be defined according to sqlalchemy orm.
>I have also question - how Neutron knows (or sqlalchemy) which
>models/tables should be created in database? At this moment I cannot
>find any code, which initializes the database. The only thing which I
>found is declarative.declarative_base in db.model_base
>And one question about creating new agents - is it just thread/process,
>which is managed by Neutron? I was analysing lbaas code and it is just
>python script in /usr/bin/, which executes class. Do I have to create
>anything additional like with database or service plugin to create new
>agent? Or scripts like in LBAAS will be enough + init script?
>I also found great diagram, which describes in a nut shell how Neutron
>service plugins are organised internal:
>Maybe it would be good idea to put diagram like this to official dev
>wiki? Of corse after some modifications. Now wiki points to the
>SecurityGroups code, which is not very helpful for beginners like me :)
>OpenStack-dev mailing list
>OpenStack-dev at lists.openstack.org

More information about the OpenStack-dev mailing list