3

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 ?

mustaccio
  • 18,234
  • 16
  • 48
  • 57
devesh-ahuja
  • 963
  • 1
  • 8
  • 24

2 Answers2

3

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

Pensu
  • 3,263
  • 10
  • 46
  • 71
2
  1. Create your model inside nova/db/sqlalchemy/models.py
  2. 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
  3. Provide upgrade() and downgrade() functions as described in this pdf
  4. sync nova db using:

nova-manage db sync

amey91
  • 542
  • 6
  • 17