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
This commit is contained in:
Sofer Athlan-Guyot 2020-04-14 23:55:54 +02:00
parent ad1d4c5216
commit 2fdda9b318
1 changed files with 13 additions and 0 deletions

View File

@ -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