From 895e453e065c4ca23722ace69c0c2707c494624a Mon Sep 17 00:00:00 2001 From: Yifei Xue Date: Sat, 16 Dec 2017 00:25:28 +0800 Subject: Bug fix for the random failure of nova cell_v2 discovery JIRA: - Sometimes nova cell_v2 fails to discovery the compute hosts. So we add some retries to makr sure cell_v2 discovery success. Change-Id: I74af78667f2718b10b8cbb1e9c7c8d8d3b4b297e Signed-off-by: Yifei Xue --- deploy/adapters/ansible/roles/config-osa/tasks/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'deploy/adapters') diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml index 046b25e5..248ed142 100755 --- a/deploy/adapters/ansible/roles/config-osa/tasks/main.yml +++ b/deploy/adapters/ansible/roles/config-osa/tasks/main.yml @@ -53,6 +53,19 @@ insertafter: '^ - qemu-img-ev' line: ' - libvirt' +- name: fix the problem of nova cell_v2 discovery + blockinfile: + dest: /etc/ansible/roles/os_nova/tasks/nova_db_post_setup.yml + insertafter: 'nova-manage cell_v2 discover_hosts' + block: | + # add retry + register: cell_v2_discovery + until: cell_v2_discovery == 0 + retries: 10 + delay: 5 + ignore_errors: true + when: hostvars[hostvars[inventory_hostname]['groups']['controller'][0]]['local_mirror'] == 'Ubuntu' + - name: remove CentOS-Base.repo after ceph-osd blockinfile: dest: /etc/ansible/roles/ceph-osd/tasks/start_osds.yml -- cgit 1.2.3-korg