From 2fdda9b31884385d88bfa433535234c305bb01de Mon Sep 17 00:00:00 2001 From: Sofer Athlan-Guyot Date: Tue, 14 Apr 2020 23:55:54 +0200 Subject: [PATCH] Make sure nova_api_ensure_cell0_database_url is deleted. After moving the nova_api_ensure_cell0_database_url from tripleo_step5 to tripleo_step3 we encounter an error where that container could not be created during update because it was not being deleted. The reasoning here is that paunch may look for container to destroy based on container live information while it creates them based of file configuration. Then moving container at an earlier step is not possible. Here we work around the issue by making sure that this container is destroyed before reaching the common deploy step task (where paunch is triggered) in the update tasks (which happen before). We look for the current live information of the container and if it is still in step5 then we delete it. To prevent such thing to happen again we would need to make sure that those container are ephemeral and get destroyed after being used. Change-Id: Iaa00c0971199b335eca415aa69af9132a3ddf225 Closes-Bug: #1872828 --- docker/services/nova-api.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index ecb7f14793..d09ca2bc8e 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -283,6 +283,19 @@ outputs: metadata_settings: get_attr: [NovaApiBase, role_data, metadata_settings] host_prep_tasks: {get_attr: [NovaApiLogging, host_prep_tasks]} + update_tasks: + - name: check at which step is nova_api_ensure_cell0_database_url + shell: "docker inspect nova_api_ensure_cell0_database_url|jq -r '.[]|.Config.Labels.config_id'" + ignore_errors: true + register: cell0_database_url_step + when: + - step|int == 1 + - name: remove nova_api_ensure_cell0_database_url explicitly. + shell: "docker rm -fv nova_api_ensure_cell0_database_url" + when: + - step|int == 1 + - cell0_database_url_step is succeeded + - cell0_database_url_step.stdout == 'tripleo_step5' upgrade_tasks: - when: step|int == 0 tags: common