ALTER TABLE vnf_lcm_filters MODIFY subscription_uuid VARCHAR(36) NOT NULL;
Traceback (most recent call last):
File "/usr/local/bin/tacker-db-manage", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/tacker/db/migration/cli.py", line 178, in main
CONF.command.func(config, CONF.command.name)
File "/usr/local/lib/python3.6/site-packages/tacker/db/migration/cli.py", line 68, in do_upgrade
do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
File "/usr/local/lib/python3.6/site-packages/tacker/db/migration/cli.py", line 47, in do_alembic_command
getattr(alembic_command, cmd)(config, *args, **kwargs)
File "/usr/lib/python3.6/site-packages/alembic/command.py", line 298, in upgrade
script.run_env()
File "/usr/lib/python3.6/site-packages/alembic/script/base.py", line 489, in run_env
util.load_python_file(self.dir, "env.py")
File "/usr/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
module = load_module_py(module_id, path)
File "/usr/lib/python3.6/site-packages/alembic/util/compat.py", line 173, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.6/site-packages/tacker/db/migration/alembic_migrations/env.py", line 82, in <module>
run_migrations_offline()
File "/usr/local/lib/python3.6/site-packages/tacker/db/migration/alembic_migrations/env.py", line 54, in run_migrations_offline
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/usr/lib/python3.6/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
self.get_context().run_migrations(**kw)
File "/usr/lib/python3.6/site-packages/alembic/runtime/migration.py", line 518, in run_migrations
step.migration_fn(**kw)
File "/usr/local/lib/python3.6/site-packages/tacker/db/migration/alembic_migrations/versions/d25c7c865ce8_mod_vnflcm_subscription.py", line 47, in upgrade
sa.Computed(sta_str)))
AttributeError: module 'sqlalchemy' has no attribute 'Computed'
[root@localhost orion-vnfd(keystone_admin)]#
3. I am planning to trying the following DB commands manually :
-- Running upgrade c47a733f425a -> ee98bbc0789d
ALTER TABLE vnf_instantiated_info ADD COLUMN scale_status JSON;
UPDATE alembic_version SET version_num='ee98bbc0789d' WHERE alembic_version.version_num = 'c47a733f425a';
Hi Yoshito, Thanks for your prompt reply and helping out on this one.
1. I tried upgrading from one to other revision but this command is failing :
[root@localhost ~(keystone_admin)]# tacker-db-manage --config-file /etc/tacker/ tacker. conf upgrade c47a733f425a: 329cd1619d41
FAILED: Range revision not allowed
[root@localhost ~(keystone_admin)]#
2. I tried with --sql option and getting the following output:
[root@localhost orion-vnfd( keystone_ admin)] # tacker-db-manage --config-file /etc/tacker/ tacker. conf upgrade c47a733f425a: 329cd1619d41 --sql runtime. migration] Context impl MySQLImpl. runtime. migration] Generating static SQL runtime. migration] Will assume non-transactional DDL. runtime. migration] Running upgrade c47a733f425a -> ee98bbc0789d, add scale column
INFO [alembic.
INFO [alembic.
INFO [alembic.
INFO [alembic.
-- Running upgrade c47a733f425a -> ee98bbc0789d
ALTER TABLE vnf_instantiate d_info ADD COLUMN scale_status JSON;
UPDATE alembic_version SET version_ num='ee98bbc078 9d' WHERE alembic_ version. version_ num = 'c47a733f425a';
INFO [alembic. runtime. migration] Running upgrade ee98bbc0789d -> 2c5211036579, add placement table
-- Running upgrade ee98bbc0789d -> 2c5211036579
CREATE TABLE placement_ constraint ( or_anti_ affinity VARCHAR(255) NOT NULL, group_name VARCHAR(255) NOT NULL,
id VARCHAR(36) NOT NULL,
vnf_instance_id VARCHAR(36) NOT NULL,
affinity_
scope VARCHAR(255) NOT NULL,
server_
resource JSON NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME,
deleted_at DATETIME,
deleted BOOL,
PRIMARY KEY (id),
CHECK (deleted IN (0, 1))
)ENGINE=InnoDB;
UPDATE alembic_version SET version_ num='2c52110365 79' WHERE alembic_ version. version_ num = 'ee98bbc0789d';
INFO [alembic. runtime. migration] Running upgrade 2c5211036579 -> d25c7c865ce8, mod_vnflcm_ subscription
-- Running upgrade 2c5211036579 -> d25c7c865ce8
ALTER TABLE vnf_lcm_filters MODIFY subscription_uuid VARCHAR(36) NOT NULL;
Traceback (most recent call last): bin/tacker- db-manage" , line 10, in <module> exit(main( )) lib/python3. 6/site- packages/ tacker/ db/migration/ cli.py" , line 178, in main command. func(config, CONF.command.name) lib/python3. 6/site- packages/ tacker/ db/migration/ cli.py" , line 68, in do_upgrade alembic_ command( config, cmd, revision, sql=CONF. command. sql) lib/python3. 6/site- packages/ tacker/ db/migration/ cli.py" , line 47, in do_alembic_command alembic_ command, cmd)(config, *args, **kwargs) python3. 6/site- packages/ alembic/ command. py", line 298, in upgrade run_env( ) python3. 6/site- packages/ alembic/ script/ base.py" , line 489, in run_env load_python_ file(self. dir, "env.py") python3. 6/site- packages/ alembic/ util/pyfiles. py", line 98, in load_python_file py(module_ id, path) python3. 6/site- packages/ alembic/ util/compat. py", line 173, in load_module_py loader. exec_module( module) _bootstrap_ external> ", line 678, in exec_module _bootstrap> ", line 219, in _call_with_ frames_ removed lib/python3. 6/site- packages/ tacker/ db/migration/ alembic_ migrations/ env.py" , line 82, in <module> migrations_ offline( ) lib/python3. 6/site- packages/ tacker/ db/migration/ alembic_ migrations/ env.py" , line 54, in run_migrations_ offline run_migrations( ) python3. 6/site- packages/ alembic/ runtime/ environment. py", line 846, in run_migrations get_context( ).run_migration s(**kw) python3. 6/site- packages/ alembic/ runtime/ migration. py", line 518, in run_migrations migration_ fn(**kw) lib/python3. 6/site- packages/ tacker/ db/migration/ alembic_ migrations/ versions/ d25c7c865ce8_ mod_vnflcm_ subscription. py", line 47, in upgrade Computed( sta_str) )) keystone_ admin)] #
File "/usr/local/
sys.
File "/usr/local/
CONF.
File "/usr/local/
do_
File "/usr/local/
getattr(
File "/usr/lib/
script.
File "/usr/lib/
util.
File "/usr/lib/
module = load_module_
File "/usr/lib/
spec.
File "<frozen importlib.
File "<frozen importlib.
File "/usr/local/
run_
File "/usr/local/
context.
File "<string>", line 8, in run_migrations
File "/usr/lib/
self.
File "/usr/lib/
step.
File "/usr/local/
sa.
AttributeError: module 'sqlalchemy' has no attribute 'Computed'
[root@localhost orion-vnfd(
3. I am planning to trying the following DB commands manually :
-- Running upgrade c47a733f425a -> ee98bbc0789d
ALTER TABLE vnf_instantiate d_info ADD COLUMN scale_status JSON;
UPDATE alembic_version SET version_ num='ee98bbc078 9d' WHERE alembic_ version. version_ num = 'c47a733f425a';
INFO [alembic. runtime. migration] Running upgrade ee98bbc0789d -> 2c5211036579, add placement table
-- Running upgrade ee98bbc0789d -> 2c5211036579
CREATE TABLE placement_ constraint ( or_anti_ affinity VARCHAR(255) NOT NULL, group_name VARCHAR(255) NOT NULL,
id VARCHAR(36) NOT NULL,
vnf_instance_id VARCHAR(36) NOT NULL,
affinity_
scope VARCHAR(255) NOT NULL,
server_
resource JSON NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME,
deleted_at DATETIME,
deleted BOOL,
PRIMARY KEY (id),
CHECK (deleted IN (0, 1))
)ENGINE=InnoDB;
UPDATE alembic_version SET version_ num='2c52110365 79' WHERE alembic_ version. version_ num = 'ee98bbc0789d';
INFO [alembic. runtime. migration] Running upgrade 2c5211036579 -> d25c7c865ce8, mod_vnflcm_ subscription
-- Running upgrade 2c5211036579 -> d25c7c865ce8
ALTER TABLE vnf_lcm_filters MODIFY subscription_uuid VARCHAR(36) NOT NULL;
4. If #3 will not work, then I will delete the tacker database and reinstall it.
Please confirm if commands listed in #3 step are correct for manual update of DB schema.