kolla-ansible/ansible/roles/nova/tasks/refresh_scheduler_cell_cache.yml
Mark Goddard 6bdf202658 Fix nova scheduler down after first docker restart
Due to a Docker bug [1] we cannot use Docker to send
SIGHUP to the container because it will mark it as
stopped.
This patch sends the signal directly to the process,
bypassing Docker.

'changed_when: false' is also removed from the
relevant task as it definitely changes the state.
In the future we could do the refresh only if
there really is a need for another one.

[1] https://github.com/moby/moby/issues/11065

Change-Id: Ief73bbd24568d6941384ea3330ab45f11aa42d37
Co-authored-by: Radosław Piliszek <radoslaw.piliszek@gmail.com>
Closes-Bug: #1845244
2019-10-25 12:32:48 +00:00

13 lines
614 B
YAML

---
# This is necessary after new cells have been created to refresh the cell cache
# in nova scheduler.
- name: Refresh cell cache in nova scheduler
become: true
# NOTE(yoctozepto): Normally we would send the signal via Docker but, due to a
# Docker bug (https://github.com/moby/moby/issues/11065), this might cause the
# container to be stopped if we restart Docker or reboot the server as we
# use the 'unless-stopped' restart policy by default.
shell: "kill -HUP `docker inspect -f '{% raw %}{{.State.Pid}}{% endraw %}' nova_scheduler`"
when:
- inventory_hostname in groups['nova-scheduler']