Adding Nova to restart

This commit is contained in:
Joe Talerico 2015-09-23 10:05:54 -04:00
parent 9e9630563d
commit 413a2f6d5a

View File

@ -1,7 +1,6 @@
#!/bin/bash
source ~/stackrc
DEBUG=true
#WORKERS="metadata_workers|osapi_compute_workers|ec2_workers|public_workers|admin_workers|rpc_workers|api_workers"
CONTROLLERS=$(nova list | grep control)
SSH_OPTS="StrictHostKeyChecking no"
declare -A WORKERS
@ -9,10 +8,6 @@ WORKERS["keystone"]="public_workers|admin_workers"
WORKERS["nova"]="metadata_workers|osapi_compute_workers|ec2_workers"
WORKERS["neutron"]="rpc_workers|api_workers"
#
# So this function pulls the current config from the hosts and just presents it -- doesn't store or use it... we could change this.
#
check_controllers()
{
for IP in $(echo "$CONTROLLERS" | awk '{print $12}' | cut -d "=" -f 2); do
@ -29,11 +24,6 @@ check_controllers()
done
}
#
# This will update each of the functions - we pass which one to update.
#
update_workers()
{
declare -A services
@ -63,7 +53,6 @@ update_workers()
for i in $(echo ${WORKERS[$osp_service]} | tr "|" "\n") ; do
echo "Copying Config files"
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo cp ${services[$osp_service]} ${services[$osp_service]}-copy
#ssh -o "${SSH_OPTS}" heat-admin@$IP sudo sed -i -e 's/$i.*/${i}=${wkr_count}/g' ${services[$worker]}
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo "sed -i -e \"s/^\(${i}\)\( \)*=\( \)*\([0-9]\)*/${i}=${wkr_count}/g\" ${services[$osp_service]}"
done
done
@ -71,7 +60,12 @@ update_workers()
IP=`echo "$CONTROLLERS" | head -n 1 | awk '{print $12}' | cut -d "=" -f 2`
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo "pcs resource restart openstack-keystone"
fi
if [ "${osp_service}" == "nova" ]; then
IP=`echo "$CONTROLLERS" | head -n 1 | awk '{print $12}' | cut -d "=" -f 2`
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo "pcs resource restart openstack-nova-api"
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo "pcs resource restart openstack-nova-conductor"
ssh -o "${SSH_OPTS}" heat-admin@$IP sudo "pcs resource restart openstack-nova-scheduler"
fi
}