From 43aad4c8b7f25976001067130b55486ad5ba98b4 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Mon, 5 Nov 2018 20:08:43 +0800 Subject: Add delay in nova when spinning VM JIRA: - Change-Id: I3c2e291fe41135b3653a78473e8851703184847f Signed-off-by: Harry Huang --- deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml | 1 + deploy/adapters/ansible/roles/post-openstack/tasks/main.yml | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index 874fcfb5..152a7dc0 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -107,6 +107,7 @@ - utility_all[0] - network_hosts[0] - horizon + - compute remote_user: root roles: - post-openstack diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml index 0bd9aeff..0efa1cdf 100644 --- a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml +++ b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml @@ -86,3 +86,12 @@ state: restarted when: - inventory_hostname in groups['horizon'] + +- name: add sleep in nova + shell: + sed -i '/return self.driver.host_power_action/i\ time.sleep(2)' manager.py + args: + chdir: /openstack/venvs/nova-{{ openstack_release }}/lib/python2.7/site-packages/nova/compute + ignore_errors: true + when: + - inventory_hostname in groups['compute'] -- cgit 1.2.3-korg