aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'extraconfig/tasks')
-rw-r--r--extraconfig/tasks/aodh_data_migration.sh19
-rwxr-xr-xextraconfig/tasks/major_upgrade_controller_pacemaker_1.sh2
-rw-r--r--extraconfig/tasks/major_upgrade_pacemaker_migrations.sh4
-rw-r--r--extraconfig/tasks/mitaka_to_newton_aodh_data_migration.yaml33
4 files changed, 55 insertions, 3 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
+
+
diff --git a/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh b/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh
index 36d85444..d67d5a1a 100755
--- a/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh
+++ b/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh
@@ -50,7 +50,7 @@ if [ "$mariadb_do_major_upgrade" = "auto" ]; then
DO_MYSQL_UPGRADE=0
fi
echo "mysql upgrade required: $DO_MYSQL_UPGRADE"
-elif [ "$mariadb_do_major_upgrade" = 0 ]; then
+elif [ "$mariadb_do_major_upgrade" = "no" ]; then
DO_MYSQL_UPGRADE=0
else
DO_MYSQL_UPGRADE=1
diff --git a/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh b/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh
index 164269dc..c36786a9 100644
--- a/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh
+++ b/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh
@@ -38,11 +38,11 @@ function is_mysql_upgrade_needed {
fi
local currentepoch=$(rpm -q --qf "%{epoch}" $name)
- local currentversion=$(rpm -q --qf "%{version}" $name)
+ local currentversion=$(rpm -q --qf "%{version}" $name | cut -d. -f-2)
local currentrelease=$(rpm -q --qf "%{release}" $name)
local newoutput=$(repoquery -a --pkgnarrow=updates --qf "%{epoch} %{version} %{release}\n" $name)
local newepoch=$(echo "$newoutput" | awk '{ print $1 }')
- local newversion=$(echo "$newoutput" | awk '{ print $2 }')
+ local newversion=$(echo "$newoutput" | awk '{ print $2 }' | cut -d. -f-2)
local newrelease=$(echo "$newoutput" | awk '{ print $3 }')
# With this we trigger the dump restore/path if we change either epoch or
diff --git a/extraconfig/tasks/mitaka_to_newton_aodh_data_migration.yaml b/extraconfig/tasks/mitaka_to_newton_aodh_data_migration.yaml
new file mode 100644
index 00000000..9414ac19
--- /dev/null
+++ b/extraconfig/tasks/mitaka_to_newton_aodh_data_migration.yaml
@@ -0,0 +1,33 @@
+heat_template_version: 2014-10-16
+
+description: >
+ Software-config for performing aodh data migration
+
+parameters:
+ controller_servers:
+ type: json
+ compute_servers:
+ type: json
+ blockstorage_servers:
+ type: json
+ objectstorage_servers:
+ type: json
+ cephstorage_servers:
+ type: json
+ input_values:
+ type: json
+ description: input values for the software deployments
+resources:
+
+ AodhMysqlMigrationScriptConfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config: {get_file: aodh_data_migration.sh}
+
+ AodhMysqlMigrationScriptDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ servers: {get_param: controller_servers}
+ config: {get_resource: AodhMysqlMigrationScriptConfig}
+ input_values: {get_param: input_values}