Ask Your Question

(1146, u"Table 'nova_api.host_mappings' doesn't exist" [closed]

asked 2017-02-26 22:10:32 -0500

does anyone know the format to create this table? I was messing around and delete it.

I tried nova-manage api_db sync and db sync, both finished successfully but table has not been recreated.

any ideas

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by bcollins
close date 2017-02-26 22:22:25.284341

1 answer

Sort by ยป oldest newest most voted

answered 2017-02-26 22:22:08 -0500

updated 2017-02-27 10:46:11 -0500

The way I corrected this was to drop this table and rerun packstack in newton.


CREATE TABLE host_mappings ( created_at datetime DEFAULT NULL, updated_at datetime DEFAULT NULL, id int(11) NOT NULL AUTO_INCREMENT, cell_id int(11) NOT NULL, host varchar(255) NOT NULL, PRIMARY KEY (id), UNIQUE KEY uniq_host_mappings0host (host), KEY cell_id (cell_id), KEY host_idx (host), CONSTRAINT host_mappings_ibfk_1 FOREIGN KEY (cell_id) REFERENCES cell_mappings (id) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8

edit flag offensive delete link more


Please, never create tables manually, Host_mappings is created while creating base cells_v2. That will potentially break nova.

Create basic cells setup with:

nova-manage cell_v2 simple_cell_setup

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-02-27 02:09:36 -0500 )edit

i didn't im fighting with packstack. and another post that simple_cell_setup does not work in an RDO upgrade from mitaka to newton. I can say that i dropped the nova_api and then let it recreate it through packstack.

bcollins gravatar imagebcollins ( 2017-02-27 09:23:04 -0500 )edit

The process to upgrade is map_cell0 to nova_cell0 database, then simple_cell_setup --transport-url blahblahblah. simple_cell_setup had a bug in newton that was already fixed upstream and might be available soon on RDO packages (don't know exactly when). Until that, all upgrades are blocked by cells

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-02-27 09:37:15 -0500 )edit

If doing an upgrade in a fresh environment (without flavors) may notice that simple_cell_setup just works and upgrade succeed, but not trust that because upgrade only checks the presence of flavors and give a false positive (this is one of the things that were fixed)

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-02-27 09:40:00 -0500 )edit

Another option is do simple_cell_setup by default, it points to nova_api_cell0 database and upgrade will be fine. The issue here is that cell0 db was wrong in newton and fixed in ocata to nova_cell0. Don't know what can happen in the future pointing to wrong db

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-02-27 09:46:07 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-02-26 22:10:32 -0500

Seen: 978 times

Last updated: Feb 27 '17