Skip to content

Instantly share code, notes, and snippets.

@derekhiggins
Last active November 30, 2015 15:52
Show Gist options
  • Save derekhiggins/dd2752c03894aa9c33b2 to your computer and use it in GitHub Desktop.
Save derekhiggins/dd2752c03894aa9c33b2 to your computer and use it in GitHub Desktop.
Upgrades temp location for script
#!/bin/bash
function run_on_host(){
ssh -t -o StrictHostKeyChecking=no heat-admin@$@
}
CONTROLLER_IPS=($(nova list | grep overcloud-controller | grep -Eo ctlplane=[0-9\.]\+ | cut -d = -f 2))
VIP=$(neutron port-show control_virtual_ip -F fixed_ips -f value | jq .ip_address | tr '"' " " )
CONTROLLER1=${CONTROLLER_IPS[0]}
for CONTROLLER in ${CONTROLLER_IPS[@]} ; do
cat upgrade_functions.sh | run_on_host $CONTROLLER dd of=/tmp/upgrade_functions.sh
done
run_on_host $CONTROLLER1 <<-EOF
set -x
source /tmp/upgrade_functions.sh
sudo pcs resource disable httpd
check_resource httpd stopped 200
sudo pcs resource disable openstack-keystone
check_resource openstack-keystone stopped 1200
sudo pcs cluster stop --all
check_resource memcached-clone stopped 1200
check_resource galera-master 1200
EOF
for CONTROLLER in ${CONTROLLER_IPS[@]} ; do
run_on_host $CONTROLLER <<-EOF
set -x
# Install OSP8
sudo curl http://ayanami.boston.devel.redhat.com/poodles/rhos-devel-ci/8.0/2015-11-23.3/RHOS-8.repo -o /etc/yum.repos.d/rhos8.repo
sudo curl http://ayanami.bos.devel.redhat.com/poodles/rhos-devel-ci/8.0-director/2015-11-20.4/RHOS-8-director.repo -o /etc/yum.repos.d/rhos8-director.repo
sudo yum update -y
# Pin messages sent to compute nodes to kilo, these will be upgraded later
sudo crudini --set /etc/nova/nova.conf upgrade_levels compute kilo
# https://bugzilla.redhat.com/show_bug.cgi?id=1284047
# Change-Id: Ib3f6c12ff5471e1f017f28b16b1e6496a4a4b435
sudo 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
sudo crudini --set /etc/swift/proxy-server.conf pipeline:main pipeline "catch_errors healthcheck cache ratelimit tempurl formpost authtoken keystone staticweb proxy-logging proxy-server"
EOF
done
run_on_host $CONTROLLER1 <<-EOF
set -x
source /tmp/upgrade_functions.sh
sudo pcs cluster start --all
check_resource memcached-clone started 1200
check_resource galera-master started 1200
# Run all the db syncs
sudo ceilometer-dbsync --config-file=/etc/ceilometer/ceilometer.conf
sudo cinder-manage db sync
sudo glance-manage --config-file=/etc/glance/glance-registry.conf db_sync
sudo heat-manage --config-file /etc/heat/heat.conf db_sync
sudo keystone-manage db_sync
sudo neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
sudo nova-manage db sync
sudo pcs resource enable openstack-keystone
check_resource openstack-keystone started 200
sudo pcs resource enable httpd
check_resource httpd started 400
check_resource openstack-heat-engine started 400
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment