aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-25 11:00:49 +0000
committerGerrit Code Review <review@openstack.org>2016-02-25 11:00:49 +0000
commit469f3be7b30eb2907669f4cd0b4cde6051d930d3 (patch)
treec0fe9ed86b27bec604737a110bef7ec1cdadf3d1 /extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh
parentcbe1474ec960207005408bc1e13da7acb2f291e7 (diff)
parent0dd10ffe4fcd9b191eaceabcd7bb124a4db10b06 (diff)
Merge "Introduce update/upgrade workflow"
Diffstat (limited to 'extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh')
-rwxr-xr-xextraconfig/tasks/major_upgrade_controller_pacemaker_2.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh b/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh
new file mode 100755
index 00000000..0b92a3bb
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+set -eu
+
+cluster_form_timeout=600
+cluster_settle_timeout=600
+galera_sync_timeout=600
+
+if [ "$(hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid)" = "$(facter hostname)" ]; then
+ pcs cluster start --all
+
+ tstart=$(date +%s)
+ while pcs status 2>&1 | grep -E '(cluster is not currently running)|(OFFLINE:)'; do
+ sleep 5
+ tnow=$(date +%s)
+ if (( tnow-tstart > cluster_form_timeout )) ; then
+ echo_error "ERROR: timed out forming the cluster"
+ exit 1
+ fi
+ done
+
+ if ! timeout -k 10 $cluster_settle_timeout crm_resource --wait; then
+ echo_error "ERROR: timed out waiting for cluster to finish transition"
+ exit 1
+ fi
+
+ pcs resource enable galera
+ check_resource galera started 600
+ pcs resource enable mongod
+ check_resource mongod started 600
+
+ tstart=$(date +%s)
+ while ! clustercheck; do
+ sleep 5
+ tnow=$(date +%s)
+ if (( tnow-tstart > galera_sync_timeout )) ; then
+ echo_error "ERROR galera sync timed out"
+ exit 1
+ fi
+ done
+
+ # Run all the db syncs
+ # TODO: check if this can be triggered in puppet and removed from here
+ ceilometer-dbsync --config-file=/etc/ceilometer/ceilometer.conf
+ cinder-manage db sync
+ glance-manage --config-file=/etc/glance/glance-registry.conf db_sync
+ heat-manage --config-file /etc/heat/heat.conf db_sync
+ keystone-manage db_sync
+ neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
+ nova-manage db sync
+
+ pcs resource enable memcached
+ check_resource memcached started 600
+ pcs resource enable rabbitmq
+ check_resource rabbitmq started 600
+ pcs resource enable redis
+ check_resource redis started 600
+ if pcs status | grep openstack-keystone; then
+ pcs resource enable openstack-keystone
+ check_resource openstack-keystone started 1800
+ fi
+ pcs resource enable httpd
+ check_resource httpd started 1800
+fi
+
+# Swift isn't controled by heat
+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 start $S
+done