during upgrade from havana to icehouse the database migration script (migrate_to_ml2.py) fails. I run it with the following options:
python -m neutron.db.migration.migrate_to_ml2 --tunnel-type gre --release icehouse openvswitch mysql://neutron:XXXXX@127.0.0.1/neutron
It returns the following trace:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/dist-packages/neutron/db/migration/migrate_to_ml2.py", line 462, in <module>
main()
File "/usr/lib/python2.7/dist-packages/neutron/db/migration/migrate_to_ml2.py", line 458, in main
args.vxlan_udp_port)
File "/usr/lib/python2.7/dist-packages/neutron/db/migration/migrate_to_ml2.py", line 138, in __call__
metadata.create_all(engine)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 2848, in create_all
tables=tables)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1479, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1122, in _run_visitor
**kwargs).traverse_single(element)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 122, in traverse_single
return meth(obj, **kw)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/ddl.py", line 56, in visit_metadata
collection = [t for t in sql_util.sort_tables(tables)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/util.py", line 39, in sort_tables
{'foreign_key': visit_foreign_key})
File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 258, in traverse
return traverse_using(iterate(obj, opts), obj, visitors)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 249, in traverse_using
meth(target)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/util.py", line 30, in visit_foreign_key
parent_table = fkey.column.table
File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 612, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "/usr/lib/python2.7/dist-packages/sqlalchemy/schema.py", line 1474, in column
tname)
sqlalchemy.exc.NoReferencedTableError: Foreign key associated with column 'ml2_network_segments.network_id' could not find table 'networks' with which to generate a foreign key to target column 'id'
If i create this table from the mysql console with this:
CREATE TABLE ml2_network_segments ( id VARCHAR(36) NOT NULL, network_id VARCHAR(36) NOT NULL, network_type VARCHAR(32) NOT NULL , physical_network VARCHAR(64), segmentation_id INT);
ALTER TABLE ml2_network_segmentsADD FOREIGN KEY (network_id) REFERENCES networks (id) ON DELETE cascade;
ALTER TABLE ml2_network_segments ADD PRIMARY KEY (id);
during upgrade from havana to icehouse the database migration script (migrate_to_ml2.py) fails. I run it with the following options: db.migration. migrate_ to_ml2 --tunnel-type gre --release icehouse openvswitch mysql:/ /neutron: XXXXX@127. 0.0.1/neutron
python -m neutron.
It returns the following trace: python2. 7/runpy. py", line 162, in _run_module_as_main python2. 7/runpy. py", line 72, in _run_code python2. 7/dist- packages/ neutron/ db/migration/ migrate_ to_ml2. py", line 462, in <module> python2. 7/dist- packages/ neutron/ db/migration/ migrate_ to_ml2. py", line 458, in main vxlan_udp_ port) python2. 7/dist- packages/ neutron/ db/migration/ migrate_ to_ml2. py", line 138, in __call__ create_ all(engine) python2. 7/dist- packages/ sqlalchemy/ schema. py", line 2848, in create_all python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1479, in _run_visitor _run_visitor( visitorcallable , element, **kwargs) python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1122, in _run_visitor .traverse_ single( element) python2. 7/dist- packages/ sqlalchemy/ sql/visitors. py", line 122, in traverse_single python2. 7/dist- packages/ sqlalchemy/ engine/ ddl.py" , line 56, in visit_metadata sort_tables( tables) python2. 7/dist- packages/ sqlalchemy/ sql/util. py", line 39, in sort_tables python2. 7/dist- packages/ sqlalchemy/ sql/visitors. py", line 258, in traverse using(iterate( obj, opts), obj, visitors) python2. 7/dist- packages/ sqlalchemy/ sql/visitors. py", line 249, in traverse_using python2. 7/dist- packages/ sqlalchemy/ sql/util. py", line 30, in visit_foreign_key python2. 7/dist- packages/ sqlalchemy/ util/langhelper s.py", line 612, in __get__ __dict_ _[self. __name_ _] = result = self.fget(obj) python2. 7/dist- packages/ sqlalchemy/ schema. py", line 1474, in column exc.NoReference dTableError: Foreign key associated with column 'ml2_network_ segments. network_ id' could not find table 'networks' with which to generate a foreign key to target column 'id'
Traceback (most recent call last):
File "/usr/lib/
"__main__", fname, loader, pkg_name)
File "/usr/lib/
exec code in run_globals
File "/usr/lib/
main()
File "/usr/lib/
args.
File "/usr/lib/
metadata.
File "/usr/lib/
tables=tables)
File "/usr/lib/
conn.
File "/usr/lib/
**kwargs)
File "/usr/lib/
return meth(obj, **kw)
File "/usr/lib/
collection = [t for t in sql_util.
File "/usr/lib/
{'foreign_key': visit_foreign_key})
File "/usr/lib/
return traverse_
File "/usr/lib/
meth(target)
File "/usr/lib/
parent_table = fkey.column.table
File "/usr/lib/
obj.
File "/usr/lib/
tname)
sqlalchemy.
If i create this table from the mysql console with this:
CREATE TABLE ml2_network_ segments ( id VARCHAR(36) NOT NULL, network_id VARCHAR(36) NOT NULL, network_type VARCHAR(32) NOT NULL , physical_network VARCHAR(64), segmentation_id INT); segmentsADD FOREIGN KEY (network_id) REFERENCES networks (id) ON DELETE cascade; segments ADD PRIMARY KEY (id);
ALTER TABLE ml2_network_
ALTER TABLE ml2_network_
No error is given.