Comment 12 for bug 1649341

Revision history for this message
Matt Riedemann (mriedem) wrote :

The map_cell0 command is not idempotent, so if you run it more than once it's going to fail the 2nd time with a duplicate entry here:

https://github.com/openstack/nova/blob/d9d9071af250409c0102e7a25e35d7521812172d/nova/cmd/manage.py#L1283

The simple_cell_setup command uses that information here to tell if we've already done the simple setup:

https://github.com/openstack/nova/blob/d9d9071af250409c0102e7a25e35d7521812172d/nova/cmd/manage.py#L1230

And then exits cleanly so simple_cell_setup is idempotent. But you can get into trouble if you run map_cell0 and then simple_cell_setup, because simple_cell_setup will exit early and then not actually perform the host mapping stuff here:

https://github.com/openstack/nova/blob/d9d9071af250409c0102e7a25e35d7521812172d/nova/cmd/manage.py#L1237

And then later when you run the nova-manage api_db sync it will fail because of the 030 API DB migration added in https://review.openstack.org/#/c/392227. The nova team needs to work on that. A manual workaround is delete the cell0 entry from the cell_mappings table in the api_db and then run simple_cell_setup again.