Fix creation of cell0

We need to use the proper db_uri() result here, like we do for the
database connection options in nova.conf, otherwise things will fail in
a multinode setup.

Change-Id: I70d27eb4456c9e8b322c05649254624d4be4c5e5
This commit is contained in:
Jens Harbott 2017-11-28 14:05:44 +00:00
parent d82d6a9f7c
commit b1f166b674
1 changed files with 7 additions and 7 deletions

View File

@ -22,20 +22,20 @@
# and not called directly. It creates a basic cellv2 setup, which is required
# from Ocata forward.
class ::Chef::Recipe
include ::Openstack
end
nova_user = node['openstack']['compute']['user']
nova_group = node['openstack']['compute']['group']
db_user = node['openstack']['db']['compute_cell0']['username']
db_password = get_password('db', 'nova_cell0')
bind_db = node['openstack']['bind_service']['db']
listen_address = if bind_db['interface']
address_for bind_db['interface']
else
listen_address = bind_db['host']
end
uri = db_uri('compute_cell0', db_user, db_password)
execute 'map cell0' do
user nova_user
group nova_group
command "nova-manage cell_v2 map_cell0 --database_connection mysql+pymysql://nova_cell0:#{db_password}@#{listen_address}/nova_cell0?charset=utf8"
command "nova-manage cell_v2 map_cell0 --database_connection #{uri}"
not_if 'nova-manage cell_v2 list_cells | grep -q cell0'
action :run
end