Bug fix for the random failure of nova cell_v2 discovery 79/49079/3
authorYifei Xue <xueyifei@huawei.com>
Fri, 15 Dec 2017 16:25:28 +0000 (00:25 +0800)
committerYifei Xue <xueyifei@huawei.com>
Sat, 16 Dec 2017 01:12:25 +0000 (09:12 +0800)
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 <xueyifei@huawei.com>
deploy/adapters/ansible/roles/config-osa/tasks/main.yml

index 046b25e..248ed14 100755 (executable)
     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