Re: [openstack-dev] [Neutron] Extending database schema from 3rd-party plugin

2015-05-13 Thread Henry Gessau
Note: I missed this email because Neutron was misspelled in the subject. I
have corrected it for this message.

On Tue, May 12, 2015, Alexey I. Froloff ra...@raorn.name wrote:
 I am developing ML2 type/mech plugin for some very special
 environment.  Because this environment is very special (using
 addressing based on physical hypervisor location), it will be
 separate package, I don't plan to alter Neutron code.  And this
 plugin needs to store some information in Neutron database.  Not
 altering existing tables, but adding couple.
 
 I'm not very good with alembic (better say not good at all),
 maybe someone can enlight me, if this possible at all and how to
 make it with minimal damage.  I am writing this plugin for Kilo
 release, and this installation is supposed to be further updated
 to next OpenStack releases.

Alembic supports migration branches. The advanced services (FW/LB/VPNaaS) have
separate migration branches for their own tables. Unfortunately neutron's
alembic script is hard-coded to only support these three external services for
now. I hope to work on a more pluggable framework in the future.

For Kilo you could try to monkeypatch neutron's script to support your
plugin's migration. Or you can try to do something like the group-based-policy
project does, by consuming the neutron migration script[1]. (GBP also has its
own migration branch.)

Find me on IRC as HenryG and I will try to help you get more familiar with
alembic and neutron's migrations.

[1]
https://github.com/stackforge/group-based-policy/blob/master/gbpservice/neutron/db/migration/cli.py


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Neutron] Extending database schema from 3rd-party plugin

2015-05-13 Thread Alexey I. Froloff
On Wed, May 13, 2015 at 08:10:54AM -0400, Henry Gessau wrote:
 Alembic supports migration branches. The advanced services (FW/LB/VPNaaS) have
 separate migration branches for their own tables. Unfortunately neutron's
 alembic script is hard-coded to only support these three external services for
 now. I hope to work on a more pluggable framework in the future.

I could add another entry in neutron/common/repos.py

 For Kilo you could try to monkeypatch neutron's script to support your
 plugin's migration. Or you can try to do something like the group-based-policy
 project does, by consuming the neutron migration script[1]. (GBP also has its
 own migration branch.)

Actually, these two methods doesn't have much difference.  cli.py
sets 'script_location', env.py sets 'version_table' (old
python-migrate had this option in migrate.cfg).  It doesn't look
like as alembic's migration branches at all, just isolated
configurations in one database.

Thank you, this is exactly what I was looking for.

-- 
Regards,--
Sir Raorn.   --- https://plus.google.com/+AlexeyFroloff


pgpSNhfW4yxKd.pgp
Description: PGP signature
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev