diff options
author | 2016-08-08 15:20:18 -0400 | |
---|---|---|
committer | 2016-08-17 12:40:06 +0000 | |
commit | 420f786a45bcd0e85c33d66d350d0e7f148f7074 (patch) | |
tree | c13a97d3ea99352fb0331922135e4e6db562e044 /extraconfig/tasks/aodh_data_migration.sh | |
parent | 0b2829480a299dcba6d5471a99ed76fb92ca31a6 (diff) |
Upgrade scripts to migrate aodh alarm data
In Newton, Aodh will be using its own mysql DB rather than
using ceilometer's mongo instance. This means we need to
migrate any existing alarm and alrm history data from
ceilometer DB to aodh mysqlDB. Upstream aodh provides us
with a aodh-data-migration utility. We need to invoke this
during the mitaka->newton upgrade procedure so data is
migrated as expected and aodh mysql backend takes over.
Closes-bug: #1611794
Change-Id: I17888b57ecf98cd83e92af2f9cdbead066b03aa3
Diffstat (limited to 'extraconfig/tasks/aodh_data_migration.sh')
-rw-r--r-- | extraconfig/tasks/aodh_data_migration.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/extraconfig/tasks/aodh_data_migration.sh b/extraconfig/tasks/aodh_data_migration.sh new file mode 100644 index 00000000..d4c29673 --- /dev/null +++ b/extraconfig/tasks/aodh_data_migration.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# This delivers the aodh data migration script to be invoked as part of the tripleo +# major upgrade workflow to migrate all the alarm data from mongodb to mysql. +# This needs to run post controller node upgrades so new aodh mysql db configured and +# running. +# +set -eu + +#Get existing mongodb connection +MONGO_DB_CONNECTION="$(crudini --get /etc/ceilometer/ceilometer.conf database connection)" + +# Get the aodh database string from hiera data +MYSQL_DB_CONNECTION="$(crudini --get /etc/aodh/aodh.conf database connection)" + +#Run migration +/usr/bin/aodh-data-migration --nosql-conn $MONGO_DB_CONNECTION --sql-conn $MYSQL_DB_CONNECTION + + |