[openstack-dev] [Neutron] Alembic migrations
Yongsheng Gong
gongysh at unitedstack.com
Mon Dec 23 03:43:59 UTC 2013
but mark mcclain <https://review.openstack.org/#/dashboard/2592> seems not
to agree it. so it is blocked for a long time.
On Sun, Dec 22, 2013 at 10:38 PM, Roman Podoliaka
<rpodolyaka at mirantis.com>wrote:
> Hi Gary,
>
> It's a known bug (the migration script creating 'agents' table is
> mistakenly not applied when running schema migrations with ML2 core
> plugin selected). There is a patch on review
> https://review.openstack.org/#/c/61677 fixing this error.
>
> Thanks,
> Roman
>
> On Sun, Dec 22, 2013 at 4:02 PM, Gary Kotton <gkotton at vmware.com> wrote:
> > Hi,
> > Anyone else encounter the following exception:
> >
> > + /usr/local/bin/neutron-db-manage --config-file
> /etc/neutron/neutron.conf
> > --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
> > No handlers could be found for logger "neutron.common.legacy"
> > INFO [alembic.migration] Context impl MySQLImpl.
> > INFO [alembic.migration] Will assume non-transactional DDL.
> > INFO [alembic.migration] Running upgrade None -> folsom, folsom initial
> > database
> > INFO [alembic.migration] Running upgrade folsom -> 2c4af419145b,
> l3_support
> > INFO [alembic.migration] Running upgrade 2c4af419145b -> 5a875d0e5c, ryu
> > INFO [alembic.migration] Running upgrade 5a875d0e5c -> 48b6f43f7471, DB
> > support for service types
> > INFO [alembic.migration] Running upgrade 48b6f43f7471 -> 3cb5d900c5de,
> > security_groups
> > INFO [alembic.migration] Running upgrade 3cb5d900c5de -> 1d76643bcec4,
> > nvp_netbinding
> > INFO [alembic.migration] Running upgrade 1d76643bcec4 -> 2a6d0b51f4bb,
> > cisco plugin cleanup
> > INFO [alembic.migration] Running upgrade 2a6d0b51f4bb -> 1b693c095aa3,
> > Quota ext support added in Grizzly
> > INFO [alembic.migration] Running upgrade 1b693c095aa3 -> 1149d7de0cfa,
> > inital port security
> > INFO [alembic.migration] Running upgrade 1149d7de0cfa -> 49332180ca96,
> ryu
> > plugin update
> > INFO [alembic.migration] Running upgrade 49332180ca96 -> 38335592a0dc,
> > nvp_portmap
> > INFO [alembic.migration] Running upgrade 38335592a0dc -> 54c2c487e913,
> 'DB
> > support for load balancing service
> > INFO [alembic.migration] Running upgrade 54c2c487e913 -> 45680af419f9,
> > nvp_qos
> > INFO [alembic.migration] Running upgrade 45680af419f9 -> 1c33fa3cd1a1,
> > Support routing table configuration on Router
> > INFO [alembic.migration] Running upgrade 1c33fa3cd1a1 -> 363468ac592c,
> > nvp_network_gw
> > INFO [alembic.migration] Running upgrade 363468ac592c -> 511471cc46b,
> Add
> > agent management extension model support
> > INFO [alembic.migration] Running upgrade 511471cc46b -> 3b54bf9e29f7,
> NEC
> > plugin sharednet
> > INFO [alembic.migration] Running upgrade 3b54bf9e29f7 -> 4692d074d587,
> > agent scheduler
> > INFO [alembic.migration] Running upgrade 4692d074d587 -> 1341ed32cc1e,
> > nvp_net_binding
> > INFO [alembic.migration] Running upgrade 1341ed32cc1e -> grizzly,
> grizzly
> > INFO [alembic.migration] Running upgrade grizzly -> f489cf14a79c, DB
> > support for load balancing service (havana)
> > INFO [alembic.migration] Running upgrade f489cf14a79c -> 176a85fc7d79,
> Add
> > portbindings db
> > INFO [alembic.migration] Running upgrade 176a85fc7d79 -> 32b517556ec9,
> > remove TunnelIP model
> > INFO [alembic.migration] Running upgrade 32b517556ec9 -> 128e042a2b68,
> > ext_gw_mode
> > INFO [alembic.migration] Running upgrade 128e042a2b68 -> 5ac71e65402c,
> > ml2_initial
> > INFO [alembic.migration] Running upgrade 5ac71e65402c -> 3cbf70257c28,
> > nvp_mac_learning
> > INFO [alembic.migration] Running upgrade 3cbf70257c28 -> 5918cbddab04,
> add
> > tables for router rules support
> > INFO [alembic.migration] Running upgrade 5918cbddab04 -> 3cabb850f4a5,
> > Table to track port to host associations
> > INFO [alembic.migration] Running upgrade 3cabb850f4a5 -> b7a8863760e,
> > Remove cisco_vlan_bindings table
> > INFO [alembic.migration] Running upgrade b7a8863760e -> 13de305df56e,
> > nec_add_pf_name
> > INFO [alembic.migration] Running upgrade 13de305df56e -> 20ae61555e95,
> DB
> > Migration for ML2 GRE Type Driver
> > INFO [alembic.migration] Running upgrade 20ae61555e95 -> 477a4488d3f4,
> DB
> > Migration for ML2 VXLAN Type Driver
> > INFO [alembic.migration] Running upgrade 477a4488d3f4 -> 2032abe8edac,
> > LBaaS add status description
> > INFO [alembic.migration] Running upgrade 2032abe8edac -> 52c5e4a18807,
> > LBaaS Pool scheduler
> > INFO [alembic.migration] Running upgrade 52c5e4a18807 -> 557edfc53098,
> New
> > service types framework (service providers)
> > INFO [alembic.migration] Running upgrade 557edfc53098 -> e6b16a30d97,
> Add
> > cisco_provider_networks table
> > INFO [alembic.migration] Running upgrade e6b16a30d97 -> 39cf3f799352,
> FWaaS
> > Havana-2 model
> > INFO [alembic.migration] Running upgrade 39cf3f799352 -> 52ff27f7567a,
> > Support for VPNaaS
> > INFO [alembic.migration] Running upgrade 52ff27f7567a -> 11c6e18605c8,
> Pool
> > Monitor status field
> > INFO [alembic.migration] Running upgrade 11c6e18605c8 -> 35c7c198ddea,
> > remove status from HealthMonitor
> > INFO [alembic.migration] Running upgrade 35c7c198ddea -> 263772d65691,
> > Cisco plugin db cleanup part II
> > INFO [alembic.migration] Running upgrade 263772d65691 -> c88b6b5fea3,
> Cisco
> > N1KV tables
> > INFO [alembic.migration] Running upgrade c88b6b5fea3 -> f9263d6df56,
> > remove_dhcp_lease
> > INFO [alembic.migration] Running upgrade f9263d6df56 -> 569e98a8132b,
> > metering
> > INFO [alembic.migration] Running upgrade 569e98a8132b -> 86cf4d88bd3,
> > remove bigswitch port tracking table
> > INFO [alembic.migration] Running upgrade 86cf4d88bd3 -> 3c6e57a23db4,
> add
> > multiprovider
> > INFO [alembic.migration] Running upgrade 3c6e57a23db4 -> 63afba73813,
> Add
> > unique constraint for id column of TunnelEndpoint
> > INFO [alembic.migration] Running upgrade 63afba73813 -> 40dffbf4b549,
> > nvp_dist_router
> > INFO [alembic.migration] Running upgrade 40dffbf4b549 -> 53bbd27ec841,
> > Extra dhcp opts support
> > INFO [alembic.migration] Running upgrade 53bbd27ec841 -> 46a0efbd8f0,
> > cisco_n1kv_multisegment_trunk
> > INFO [alembic.migration] Running upgrade 46a0efbd8f0 -> 2a3bae1ceb8, NEC
> > Port Binding
> > INFO [alembic.migration] Running upgrade 2a3bae1ceb8 -> 14f24494ca31, DB
> > Migration for Arista ml2 mechanism driver
> > INFO [alembic.migration] Running upgrade 14f24494ca31 -> 32a65f71af51,
> ml2
> > portbinding
> > INFO [alembic.migration] Running upgrade 32a65f71af51 -> 66a59a7f516,
> NEC
> > OpenFlow Router
> > INFO [alembic.migration] Running upgrade 66a59a7f516 -> 51b4de912379,
> Cisco
> > Nexus ML2 mechanism driver
> > INFO [alembic.migration] Running upgrade 51b4de912379 -> 1efb85914233,
> > allowedaddresspairs
> > INFO [alembic.migration] Running upgrade 1efb85914233 -> 38fc1f6789f8,
> > Cisco N1KV overlay support
> > INFO [alembic.migration] Running upgrade 38fc1f6789f8 -> 4a666eb208c2,
> > service router
> > INFO [alembic.migration] Running upgrade 4a666eb208c2 -> 338d7508968c,
> > vpnaas peer_address size increase
> > INFO [alembic.migration] Running upgrade 338d7508968c -> 3ed8f075e38a,
> nvp
> > fwaas plugin
> > INFO [alembic.migration] Running upgrade 3ed8f075e38a -> 3d6fae8b70b0,
> nvp
> > lbaas plugin
> > INFO [alembic.migration] Running upgrade 3d6fae8b70b0 -> 1064e98b7917,
> > nec-pf-port-del
> > INFO [alembic.migration] Running upgrade 1064e98b7917 -> 2528ceb28230,
> NEC
> > PacketFilter network_id nullable fix
> > INFO [alembic.migration] Running upgrade 2528ceb28230 -> 3a520dd165d0,
> > Cisco Nexus multi-switch
> > INFO [alembic.migration] Running upgrade 3a520dd165d0 -> 27ef74513d33,
> > quota_in_plumgrid_plugin
> > INFO [alembic.migration] Running upgrade 27ef74513d33 -> havana, havana
> > INFO [alembic.migration] Running upgrade havana -> e197124d4b9, add
> unique
> > constraint to members
> > INFO [alembic.migration] Running upgrade e197124d4b9 -> 1fcfc149aca4,
> Add a
> > unique constraint on (agent_type, host) columns to prevent a race
> > condition when an agent entry is 'upserted'.
> > Traceback (most recent call last):
> > File "/usr/local/bin/neutron-db-manage", line 10, in <module>
> > sys.exit(main())
> > File "/opt/stack/neutron/neutron/db/migration/cli.py", line 143, in
> main
> > CONF.command.func(config, CONF.command.name)
> > File "/opt/stack/neutron/neutron/db/migration/cli.py", line 80, in
> > do_upgrade_downgrade
> > do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
> > File "/opt/stack/neutron/neutron/db/migration/cli.py", line 59, in
> > do_alembic_command
> > getattr(alembic_command, cmd)(config, *args, **kwargs)
> > File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line
> > 124, in upgrade
> > script.run_env()
> > File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line
> 199,
> > in run_env
> > util.load_python_file(self.dir, 'env.py')
> > File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line
> 198,
> > in load_python_file
> > module = load_module(module_id, path)
> > File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line
> 55,
> > in load_module
> > mod = imp.load_source(module_id, path, fp)
> > File
> "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py",
> > line 105, in <module>
> > run_migrations_online()
> > File
> "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py",
> > line 89, in run_migrations_online
> > options=build_options())
> > File "<string>", line 7, in run_migrations
> > File "/usr/local/lib/python2.7/dist-packages/alembic/environment.py",
> line
> > 652, in run_migrations
> > self.get_context().run_migrations(**kw)
> > File "/usr/local/lib/python2.7/dist-packages/alembic/migration.py",
> line
> > 225, in run_migrations
> > change(**kw)
> > File
> >
> "/opt/stack/neutron/neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py",
> > line 50, in upgrade
> > local_cols=['agent_type', 'host']
> > File "<string>", line 7, in create_unique_constraint
> > File "/usr/local/lib/python2.7/dist-packages/alembic/operations.py",
> line
> > 544, in create_unique_constraint
> > schema=schema, **kw)
> > File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line
> > 135, in add_constraint
> > self._exec(schema.AddConstraint(const))
> > File "/usr/local/lib/python2.7/dist-packages/alembic/ddl/impl.py", line
> > 76, in _exec
> > conn.execute(construct, *multiparams, **params)
> > File
> "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
> > line 1449, in execute
> > params)
> > File
> "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
> > line 1542, in _execute_ddl
> > compiled
> > File
> "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
> > line 1698, in _execute_context
> > context)
> > File
> "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py",
> > line 1691, in _execute_context
> > context)
> > File
> > "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py",
> line
> > 331, in do_execute
> > cursor.execute(statement, parameters)
> > File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174,
> in
> > execute
> > self.errorhandler(self, exc, value)
> > File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line
> 36,
> > in defaulterrorhandler
> > raise errorclass, errorvalue
> > sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1146, "Table
> > 'neutron_ml2.agents' doesn't exist") 'ALTER TABLE agents ADD CONSTRAINT
> > uniq_agents0agent_type0host UNIQUE (agent_type, host)' ()
> >
> > Thanks
> > Gary
> >
> > _______________________________________________
> > OpenStack-dev mailing list
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131223/96860f40/attachment.html>
More information about the OpenStack-dev
mailing list