you would also have to add migration file in nova/db/sqlalchemy/migrate_repo/versions/, after that do 'nova-manage db sync'. The new table should be reflected now. HTH
How to add a table in Nova Database : Openstack
-
01-07-2022 - |
Question
I'm adding one class nova.db.sqlalchemy.models to create associated table in Nova DB but its not reflecting there.
Doing same in neutron is creating a Table in Neutron DB.
Openstack documentation does not explains how to extend the database anywhere. http://docs.openstack.org/developer/nova/api/nova.db.sqlalchemy.models.html
How this issue can be resolved ?
Solution
OTHER TIPS
- Create your model inside nova/db/sqlalchemy/models.py
- Create migration file inside nova/db/sqlalchemy/migrate_repo/versions/ .
You can do this by simply adding a .py file with an increased version number - Provide upgrade() and downgrade() functions as described in this pdf
- sync nova db using:
nova-manage db sync
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow