From 557c0c358f9b9eacc74f1bfe169af7cfa2c18cd0 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Thu, 23 Jan 2020 11:49:28 -0500 Subject: [PATCH] Check to make sure compute service is deployed before scale down Currently during a node scale down using openstack overcloud node delete, we assume the that nova-compute is enabled on the node and is working as expected. However, the node scale down fails in cases where the node being scaled is not correctly behaving as a compute node (nova containers not running/reporting to the overcloud). This patch includes a check to only disable and stop nova services if they are running. We ran into this scenario when we wanted to scale down a node that did not cleanly deploy as a compute node due to failure in step 5 in a large scale environment. Change-Id: Ic8225af65c409b6a32d4bb2def370c7c802147fa Co-Authored-By: Luke Short Closes-Bug: #1860694 Signed-off-by: Sai Sindhur Malleni (cherry picked from commit 119769384f944e20b0f11c86ed68c5ffeb8385c5) --- .../nova/nova-compute-container-puppet.yaml | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index b10846e5ec..e727b9d285 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -1101,31 +1101,32 @@ outputs: -> {{ nova_compute_service }}. when: - (nova_compute_service | length) > 1 - - name: Disable nova-compute service - command: openstack compute service set {{ nova_compute_service[0].Host }} nova-compute --disable - delegate_to: localhost - check_mode: no + - name: Disable nova services when: - - (nova_compute_service | length) <= 1 - - not is_additional_cell|bool - - name: Stop nova-compute healthcheck container - service: - name: tripleo_nova_compute_healthcheck - state: stopped - enabled: no - become: true - - name: Stop nova-compute container - service: - name: tripleo_nova_compute - state: stopped - enabled: no - become: true - - name: Delete nova-compute service - command: openstack compute service delete {{ nova_compute_service[0].ID }} - delegate_to: localhost - check_mode: no - when: - - (nova_compute_service | length) <= 1 + - (nova_compute_service | length) == 1 + block: + - name: Disable nova-compute service + command: openstack compute service set {{ nova_compute_service[0].Host }} nova-compute --disable + delegate_to: localhost + check_mode: no + when: + - not is_additional_cell|bool + - name: Stop nova-compute healthcheck container + service: + name: tripleo_nova_compute_healthcheck + state: stopped + enabled: no + become: true + - name: Stop nova-compute container + service: + name: tripleo_nova_compute + state: stopped + enabled: no + become: true + - name: Delete nova-compute service + command: openstack compute service delete {{ nova_compute_service[0].ID }} + delegate_to: localhost + check_mode: no fast_forward_upgrade_tasks: - when: - step|int == 0