
For N we cannot assume services are managed by pacemaker. This adds functions to check if a service is systemd or pcmk managed and start/stops it accordingly. For pcmk, only stop/disable on bootstrap node for example, whereas systemd should stop/start on all controllers. There is also an equivalent change to the check_resource which has been reworked to allow both pcmk and systemd. Implements: blueprint overcloud-upgrades-workflow-mitaka-to-newton Change-Id: Ic8252736781dc906b3aef8fc756eb8b2f3bb1f02
26 lines
759 B
Bash
Executable File
26 lines
759 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eux
|
|
|
|
# Run if pacemaker is running, we're the bootstrap node,
|
|
# and we're updating the deployment (not creating).
|
|
if [[ -n $(pcmk_running) && -n $(is_bootstrap_node) ]]; then
|
|
|
|
TIMEOUT=600
|
|
SERVICES_TO_RESTART="$(ls /var/lib/tripleo/pacemaker-restarts)"
|
|
PCS_STATUS_OUTPUT="$(pcs status)"
|
|
|
|
for service in $SERVICES_TO_RESTART; do
|
|
if ! echo "$PCS_STATUS_OUTPUT" | grep $service; then
|
|
echo "Service $service not found as a pacemaker resource, cannot restart it."
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
for service in $SERVICES_TO_RESTART; do
|
|
echo "Restarting $service..."
|
|
pcs resource restart --wait=$TIMEOUT $service
|
|
rm -f /var/lib/tripleo/pacemaker-restarts/$service
|
|
done
|
|
fi
|