From 4efdeb4e69f3b254282f42a9d0c740cc42af0475 Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Fri, 2 Aug 2019 13:41:44 -0400 Subject: [PATCH] Update mysql url for cell0 in step3 When doing a TLS brown field deployment (ie. updating a previously deployed system without internal TLS to using internal TLS), the database endpoint stored in the db for the default cell and cell0 must be changed in step3. Logic already exists in step 3 to change the default cell. Logic has been added to change cell0. Note that this is not a problem in stein+ because we have already added logic to set the db endpoint for both cells using templated values for both cells in step 3. Closes-Bug: 1838804 Change-Id: I3a0bc2ba62c9c0a2f4860a5b362f59251e858fcb --- docker/services/nova-api.yaml | 23 ++++++++++++++++++- ...l0-db-entry-in-step3-9af22193c34e7edd.yaml | 5 ++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/update-cell0-db-entry-in-step3-9af22193c34e7edd.yaml diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index 4ffec27bf2..b8a1c8bbc4 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -155,6 +155,13 @@ outputs: echo "(cellv2) Creating default cell_v2 cell" su nova -s /bin/bash -c "/usr/bin/nova-manage cell_v2 create_cell --name=default" fi + nova_api_ensure_cell0_database_url.sh: + mode: "0700" + content: + str_replace: + template: su nova -s /bin/bash -c "nova-manage cell_v2 list_cells --verbose | grep 'CELL' || nova-manage cell_v2 update_cell --cell_uuid 00000000-0000-0000-0000-000000000000 --transport-url 'none:///' --database_connection='CELL'" + params: + CELL: {get_attr: [NovaApiBase, role_data, config_settings, "nova::cell0_database_connection"]} docker_config: step_2: get_attr: [NovaApiLogging, docker_config, step_2] @@ -195,11 +202,25 @@ outputs: - /var/lib/docker-config-scripts/nova_api_ensure_default_cell.sh:/nova_api_ensure_default_cell.sh:ro user: root command: "/usr/bin/bootstrap_host_exec nova_api /nova_api_ensure_default_cell.sh" - nova_db_sync: + nova_api_ensure_cell0_database_url: start_order: 3 image: *nova_api_image net: host detach: false + volumes: + list_concat: + - *nova_api_bootstrap_volumes + - + - /var/log/containers/nova:/var/log/nova + - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro + - /var/lib/docker-config-scripts/nova_api_ensure_cell0_database_url.sh:/nova_api_ensure_cell0_database_url.sh:ro + user: root + command: "/usr/bin/bootstrap_host_exec nova_api /nova_api_ensure_cell0_database_url.sh" + nova_db_sync: + start_order: 4 + image: *nova_api_image + net: host + detach: false volumes: *nova_api_bootstrap_volumes user: root command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage db sync'" diff --git a/releasenotes/notes/update-cell0-db-entry-in-step3-9af22193c34e7edd.yaml b/releasenotes/notes/update-cell0-db-entry-in-step3-9af22193c34e7edd.yaml new file mode 100644 index 0000000000..690657150a --- /dev/null +++ b/releasenotes/notes/update-cell0-db-entry-in-step3-9af22193c34e7edd.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Fixes an issue whereby TLS Everywhere brownfield deployments were + timing out because the db entry for cell0 in the database was not + being updated in step 3. This entry is now updated in step 3.