aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/tasks/major_upgrade_pacemaker_1.sh
diff options
context:
space:
mode:
authorDerek Higgins <derekh@redhat.com>2015-12-03 23:45:15 +0000
committerJiri Stransky <jistr@redhat.com>2016-02-23 16:28:43 +0100
commitaa5d0120f2ec3965f58ad6b8deec342853e840d7 (patch)
treeaf110053eea994e631b98f5282654c555737df22 /extraconfig/tasks/major_upgrade_pacemaker_1.sh
parentef73827d736124bf609b0c06ee6d0d05353bd596 (diff)
Add resources for major upgrade in Pacemaker scenario
Add Heat software deployments to be used to upgrade major versions of OpenStack on the controller nodes. All controller services are taken down while the upgrade is in progress. The new updated yum repositories should be configured by another process e.g. the deployment artifacts transfer via Swift. Change-Id: Ia0a04e4a11d67e7a5acc53c1f8a8f01ed5ca8675 Co-Authored-By: Giulio Fidente <gfidente@redhat.com> Co-Authored-By: Jiri Stransky <jistr@redhat.com>
Diffstat (limited to 'extraconfig/tasks/major_upgrade_pacemaker_1.sh')
-rwxr-xr-xextraconfig/tasks/major_upgrade_pacemaker_1.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/extraconfig/tasks/major_upgrade_pacemaker_1.sh b/extraconfig/tasks/major_upgrade_pacemaker_1.sh
new file mode 100755
index 00000000..bee9a939
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_pacemaker_1.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+set -eu
+
+cluster_sync_timeout=600
+
+if pcs status 2>&1 | grep -E '(cluster is not currently running)|(OFFLINE:)'; then
+ echo_error "ERROR: upgrade cannot start with some cluster nodes being offline"
+ exit 1
+fi
+
+if [ "$(hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid)" = "$(facter hostname)" ]; then
+ pcs resource disable httpd
+ check_resource httpd stopped 1800
+ if pcs status | grep openstack-keystone; then
+ pcs resource disable openstack-keystone
+ check_resource openstack-keystone stopped 1800
+ fi
+ pcs resource disable redis
+ check_resource redis stopped 600
+ pcs resource disable mongod
+ check_resource mongod stopped 600
+ pcs resource disable rabbitmq
+ check_resource rabbitmq stopped 600
+ pcs resource disable memcached
+ check_resource memcached stopped 600
+ pcs resource disable galera
+ check_resource galera stopped 600
+ pcs cluster stop --all
+fi
+
+# Swift isn't controled by pacemaker
+for S in openstack-swift-account-auditor openstack-swift-account-reaper openstack-swift-account-replicator openstack-swift-account \
+openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container \
+openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object openstack-swift-proxy; do
+ systemctl stop $S
+done
+
+tstart=$(date +%s)
+while systemctl is-active pacemaker; do
+ sleep 5
+ tnow=$(date +%s)
+ if (( tnow-tstart > cluster_sync_timeout )) ; then
+ echo_error "ERROR: cluster shutdown timed out"
+ exit 1
+ fi
+done
+
+yum update -y
+
+# Pin messages sent to compute nodes to kilo, these will be upgraded later
+crudini --set /etc/nova/nova.conf upgrade_levels compute liberty
+# https://bugzilla.redhat.com/show_bug.cgi?id=1284047
+# Change-Id: Ib3f6c12ff5471e1f017f28b16b1e6496a4a4b435
+crudini --set /etc/ceilometer/ceilometer.conf DEFAULT rpc_backend rabbit
+# https://bugzilla.redhat.com/show_bug.cgi?id=1284058
+# Ifd1861e3df46fad0e44ff9b5cbd58711bbc87c97 Swift Ceilometer middleware no longer exists
+crudini --set /etc/swift/proxy-server.conf pipeline:main pipeline "catch_errors healthcheck cache ratelimit tempurl formpost authtoken keystone staticweb proxy-logging proxy-server"