[openstack-dev] [Neutron] Gap 0 (database migrations) closed!

Jakub Libosvar libosvar at redhat.com
Wed Jul 16 14:41:57 UTC 2014


On 07/16/2014 04:29 PM, Paddu Krishnan (padkrish) wrote:
> Hello,
> A follow-up development question related to this:
> 
> As a part of https://review.openstack.org/#/c/105563/, which was
> introducing a new table in Neutron DB, I was trying to send for review a
> new file in neutron/db/migration/alembic_migrations/versions/
> <https://review.openstack.org/#/c/105563/4/neutron/db/migration/alembic_migrations/versions/1be5bdeb1d9a_ml2_network_overlay_type_driver.py> which
> got generated through script "neutron-db-manage". This also
> updated  neutron/db/migration/alembic_migrations/versions/
> <https://review.openstack.org/#/c/105563/4/neutron/db/migration/alembic_migrations/versions/1be5bdeb1d9a_ml2_network_overlay_type_driver.py>HEAD.
> I was trying to send this file for review as well.
> 
> "git review" failed and I saw merge errors
> in neutron/db/migration/alembic_migrations/versions/
> <https://review.openstack.org/#/c/105563/4/neutron/db/migration/alembic_migrations/versions/1be5bdeb1d9a_ml2_network_overlay_type_driver.py>HEAD. 
> 
> W/O HEAD modified, jenkins was failing. I am working to fix this and saw
> this e-mail. 
> 
> I had to go through all the links in detail in this thread. But,
> meanwhile, the two points mentioned below looks related to the
> patch/issues I am facing. 
> So, if I add a new table, I don't need to run the "neutron-db-manage"
> script to generate the file and modify the HEAD anymore? Is (2) below
> need to be done manually?
Hi Paddu,

the process is the same (create migration script, update HEAD file), but
all migrations should have

    migration_for_plugins = ['*']


Because you created a new DB model in new module, you also need to add

    from neutron.plugins.ml2.drivers import type_network_overlay

to neutron/db/migration/models/head.py module.

I hope it helps.

Kuba

> 
> Thanks,
> Paddu



> 
> From: Anna Kamyshnikova <akamyshnikova at mirantis.com
> <mailto:akamyshnikova at mirantis.com>>
> Reply-To: "OpenStack Development Mailing List (not for usage questions)"
> <openstack-dev at lists.openstack.org
> <mailto:openstack-dev at lists.openstack.org>>
> Date: Wednesday, July 16, 2014 1:14 AM
> To: "OpenStack Development Mailing List (not for usage questions)"
> <openstack-dev at lists.openstack.org
> <mailto:openstack-dev at lists.openstack.org>>
> Subject: Re: [openstack-dev] [Neutron] Gap 0 (database migrations) closed!
> 
> Hello everyone!
> 
> I would like to bring the next two points to everybody's attention:
> 
> 1) As Henry mentioned if you add new migration you should make it
> unconditional. Conditional migrations should not be merged since now.
> 
> 2) If you add some new models you should ensure that module containing
> it is imported in /neutron/db/migration/models/head.py.
> 
> The second point in important for testing which I hope will be merged
> soon: https://review.openstack.org/76520.
> 
> Regards,
> Ann
> 
> 
> 
> On Wed, Jul 16, 2014 at 5:54 AM, Kyle Mestery <mestery at mestery.com
> <mailto:mestery at mestery.com>> wrote:
> 
>     On Tue, Jul 15, 2014 at 5:49 PM, Henry Gessau <gessau at cisco.com
>     <mailto:gessau at cisco.com>> wrote:
>     > I am happy to announce that the first (zero'th?) item in the Neutron Gap
>     > Coverage[1] has merged[2]. The Neutron database now contains all tables for
>     > all plugins, and database migrations are no longer conditional on the
>     > configuration.
>     >
>     > In the short term, Neutron developers who write migration scripts need to set
>     >   migration_for_plugins = ['*']
>     > but we will soon clean up the template for migration scripts so that this will
>     > be unnecessary.
>     >
>     > I would like to say special thanks to Ann Kamyshnikova and Jakub Libosvar for
>     > their great work on this solution. Also thanks to Salvatore Orlando and Mark
>     > McClain for mentoring this through to the finish.
>     >
>     > [1]
>     > https://wiki.openstack.org/wiki/Governance/TechnicalCommittee/Neutron_Gap_Coverage
>     > [2] https://review.openstack.org/96438
>     >
>     This is great news! Thanks to everyone who worked on this particular
>     gap. We're making progress on the other gaps identified in that plan,
>     I'll send an email out once Juno-2 closes with where we're at.
> 
>     Thanks,
>     Kyle
> 
>     > _______________________________________________
>     > OpenStack-dev mailing list
>     > OpenStack-dev at lists.openstack.org
>     <mailto:OpenStack-dev at lists.openstack.org>
>     > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
>     _______________________________________________
>     OpenStack-dev mailing list
>     OpenStack-dev at lists.openstack.org
>     <mailto:OpenStack-dev at lists.openstack.org>
>     http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 




More information about the OpenStack-dev mailing list