From fe9a338b13411ca0f969dd9e71f6cfc309162c44 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Thu, 23 Nov 2017 11:36:13 +0000 Subject: [PATCH] Do not implement reload for novnc/spice service The nova-novncproxy and nova-spicehtml5proxy services do not support using a HUP signal to reload, so they need to be restarted instead. This patch ensures that these services are restarted, and also fixes a bug that hasn't been noticed before where if the Placement API and other nova services are implemented on the same host/container then the other services would not be restarted. It would play out like this: - The first task asks to reload all nova services execute against all nova hosts, except those running the placement api. This results in only the compute hosts getting the reload. - The second task only asks the nova placement API to restart. This leaves out all the other nova services which are on the same host. Change-Id: Id4b9caa1cdfd0f53023548c4ede5d497d64c873d Needed-By: I36e2200e2ca43d87208d2c4edb17b98654bb121e --- playbooks/os-nova-install.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index 5ea0b71dab..41ef6fc84e 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -173,11 +173,11 @@ run_once: yes -# Note that the placement API service does not understand how to reload, -# so it fails when you try to make it do so. We therefore skip the reload -# for that service. -- name: Reload all nova services to ensure new RPC object version is used - hosts: "nova_all:!nova_api_placement" +# Note that the placement API service and the console services do not +# understand how to reload, so they fail when you try to make them do +# so. We therefore restart them instead. +- name: Reload all nova services which support a reload to ensure new RPC object version is used + hosts: "nova_all:!nova_api_placement:!nova_console" gather_facts: no serial: "{{ nova_serial | default('100%') }}" max_fail_percentage: 20 @@ -191,17 +191,18 @@ vars: service_name: "nova" service_action: "reloaded" - service_negate: "{{ ['nova-placement-api.service'] + nova_service_negate | default([]) }}" + service_negate: "{{ ['nova-placement-api.service', 'nova-novncproxy.service', 'nova-spicehtml5proxy.service' ] + nova_service_negate | default([]) }}" when: - "nova_all_software_updated | bool" - "ansible_local['openstack_ansible']['nova']['need_service_restart'] | bool" -# Note that the placement API service does not understand how to reload, -# so it fails when you try to make it do so. We therefore restart it instead. -- name: Restart the nova placement API service to ensure new RPC object version is used - hosts: "nova_api_placement" +# Note that the placement API service and the console services do not +# understand how to reload, so they fail when you try to make them do +# so. We therefore restart them instead. +- name: Restart the remaining nova services to ensure new RPC object version is used + hosts: "nova_api_placement:nova_console" gather_facts: no serial: "{{ nova_api_serial | default(['1', '100%']) }}" max_fail_percentage: 20 @@ -213,7 +214,7 @@ - name: Execute nova service restart include: common-tasks/restart-service.yml vars: - service_name: "nova-placement-api" + service_name: "nova" service_action: "restarted" service_fact: "nova" when: