Skip to content

Instantly share code, notes, and snippets.

@cloudnull
Last active December 31, 2015 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudnull/7964317 to your computer and use it in GitHub Desktop.
Save cloudnull/7964317 to your computer and use it in GitHub Desktop.
RCBOPS Grizzly to Havana Upgrade process
#!/usr/bin/env bash
set -e
# Set to true if you want this
FIX_QEMU=${FIX_QEMU:false}
# Before deploying New Cookbooks / Code Backup your quantum Database.
mysqldump quantum > ~/quantum.mysql.sql
if [ ! -f "~/quantum.mysql.sql" ];then
echo "Database Backup for Quantum not found, You must dump your database first"
exit 1
fi
# Delete cached Cookbooks
for i in /var/chef/cache/cookbooks/*;do rm -rf $i; done
# Get new cookbooks, NOTE THIS COMMAND IS USING THE RC BRANCH.
git clone -b "v4.2.1rc" https://github.com/rcbops/chef-cookbooks chef-cookbooks
# Update all the things
pushd chef-cookbooks
git submodule init && git submodule sync && git submodule update
knife cookbook upload -a -o cookbooks/ && knife role from file roles/*.rb
popd
# Get deps
apt-get install -y python-dev
# Get the Mungerator
git clone https://github.com/cloudnull/rcbops_mungerator mungerator
# Install the Mungerator
pushd mungerator
python setup.py install
popd
# Run the mungerator
mungerator munger --client-key /etc/chef-server/admin.pem --auth-url https://127.0.0.1:4000 all-nodes-in-env --name allinoneinone
# On all controllers remove the quantum monit configs
rm /etc/monit/conf.d/quantum-*
# Run chef on all your nodes.
chef-client
if [ "${FIX_QEMU}" == true ];then
# Fix QEMU if needed
apt-get update && apt-get -y remove qemu-utils && apt-get install qemu-utils
fi
# Resolve version conflict with Neutron Client Packages
apt-get update && apt-get install python-cmd2 python-pyparsing
# Stop Neutron Server
service neutron-server stop
# Drop the current Quantum Database
mysql -e "drop database quantum"
# Recreate the Quantum Database
mysql -e "create database quantum"
# ReImport the Quantum Database
mysql -o quantum < quantum.mysql.sql
# STAMP THE QUANTUM DB AS GRIZZLY. THIS IS A MUST DO!
neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini stamp grizzly
# Upgrade Neutron Database to havana
neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini upgrade havana
# Start Neutron Service
service neutron-server start
echo "Happy Openstacking :)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment