From 9418c59bf42d7f7c0348580e372a7ca5ddbbb1d8 Mon Sep 17 00:00:00 2001 From: grakiss Date: Wed, 9 Mar 2016 21:55:15 -0500 Subject: Improve restart duration of odl JIRA:COMPASS-333 - restart neutron service in serial mode - restart odl service in parallel mode Change-Id: I95b9037d335247ac5d4d77c7e10a2109d9b4c6a6 Signed-off-by: grakiss --- .../ansible/openstack/HA-ansible-multinodes.yml | 6 ++++++ .../roles/odl_cluster_neutron/tasks/main.yml | 22 ++++++++++++++++++++++ .../ansible/roles/odl_cluster_post/tasks/main.yml | 22 ---------------------- 3 files changed, 28 insertions(+), 22 deletions(-) create mode 100755 deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml mode change 100755 => 100644 deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index 20f1f197..96502e2d 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -214,6 +214,12 @@ remote_user: root serial: 1 max_fail_percentage: 0 + roles: + - odl_cluster_neutron + +- hosts: all + remote_user: root + max_fail_percentage: 0 roles: - odl_cluster_post diff --git a/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml new file mode 100755 index 00000000..751a02d7 --- /dev/null +++ b/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- name: restart neutron-server + service: name=neutron-server state=restarted enabled=yes + when: inventory_hostname in groups['odl'] + +- name: add service daemon + shell: > + echo keepalived >> /opt/service ; + echo neutron-server >> /opt/service ; + when: inventory_hostname in groups['odl'] + +- name: restart neutron-l3-agent server + service: name=neutron-l3-agent state=restarted + when: inventory_hostname in groups['odl'] + +- name: restart neutron-dhcp-agent server + service: name=neutron-dhcp-agent state=restarted + when: inventory_hostname in groups['odl'] + +- name: restart neutron-metadata-agent server + service: name=neutron-metadata-agent state=restarted + when: inventory_hostname in groups['odl'] diff --git a/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml old mode 100755 new mode 100644 index 19e99e82..8432186c --- a/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml +++ b/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml @@ -1,26 +1,4 @@ --- -- name: restart neutron-server - service: name=neutron-server state=restarted enabled=yes - when: inventory_hostname in groups['odl'] - -- name: add service daemon - shell: > - echo keepalived >> /opt/service ; - echo neutron-server >> /opt/service ; - when: inventory_hostname in groups['odl'] - -- name: restart neutron-l3-agent server - service: name=neutron-l3-agent state=restarted - when: inventory_hostname in groups['odl'] - -- name: restart neutron-dhcp-agent server - service: name=neutron-dhcp-agent state=restarted - when: inventory_hostname in groups['odl'] - -- name: restart neutron-metadata-agent server - service: name=neutron-metadata-agent state=restarted - when: inventory_hostname in groups['odl'] - - name: restart opendaylight shell: sleep 60; service opendaylight restart; sleep 300; when: inventory_hostname in groups['odl'] -- cgit 1.2.3-korg