From 92314ac4c46c1436f4e4317ecb8ad0bbbb72db6c Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 3 Feb 2016 21:17:23 +0100 Subject: [PATCH] NovaCompute: Call "fence_compute -o on" after evacuation This reenables the service for that node (by removing the force_down attribute); without this, the compute node will stay marked as down. This replaces the code that was commented out to re-enable the service. Change-Id: Id981dc1b80bbbac7b294ab7fd9e24b3757765826 --- ocf/NovaCompute | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ocf/NovaCompute b/ocf/NovaCompute index 8032c6a..3e5a867 100644 --- a/ocf/NovaCompute +++ b/ocf/NovaCompute @@ -168,6 +168,8 @@ nova_start() { ocf_log info "Pausing to give evacuations from ${NOVA_HOST} time to complete" sleep ${OCF_RESKEY_evacuation_delay} + fence_compute ${fence_options} -o on -n ${NOVA_HOST} + attrd_updater -p -n evacuate -N ${NOVA_HOST} -D else ocf_log info "Waiting for pending evacuations from ${NOVA_HOST}" while [ "x$state" != "xno" ]; do @@ -177,6 +179,9 @@ nova_start() { ocf_log info "Pausing to give evacuations from ${NOVA_HOST} time to complete" sleep ${OCF_RESKEY_evacuation_delay} + + fence_compute ${fence_options} -o on -n ${NOVA_HOST} + attrd_updater -p -n evacuate -N ${NOVA_HOST} -D fi export LIBGUESTFS_ATTACH_METHOD=appliance @@ -189,24 +194,6 @@ nova_start() { rc=$? done -## TEMPORARY disable call to "service enable" that seems to create -## issues and it is unnecessary since fence_compute doesn't disable -## the service - -# if [ "x${OCF_RESKEY_domain}" != x ]; then -# export service_host="${NOVA_HOST}.${OCF_RESKEY_domain}" -# else -# export service_host="${NOVA_HOST}" -# fi - -# python -c "import os; from novaclient import client as nova_client; nova = nova_client.Client('2', os.environ.get('OCF_RESKEY_username'), os.environ.get('OCF_RESKEY_password'), os.environ.get('OCF_RESKEY_tenant_name'), os.environ.get('OCF_RESKEY_auth_url')); nova.services.enable(os.environ.get('service_host'), 'nova-compute');" - -# rc=$? -# if [ $rc != 0 ]; then -# ocf_exit_reason "nova.services.enable failed $rc" -# exit $OCF_NOT_RUNNING -# fi - return $OCF_SUCCESS }