summaryrefslogtreecommitdiffstats
path: root/scripts/flush_odl.sh
diff options
context:
space:
mode:
authorJuraj Linkeš <jlinkes@cisco.com>2017-05-03 13:24:14 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-03 13:24:14 +0000
commit6ad0c96f1b4383c3bcd651cc246843119f4e0e61 (patch)
treef7847d6e4bd7c418461e68d7f689a3a83ebc9b3b /scripts/flush_odl.sh
parent1029ebce0186072709e22a44c2b0cbb5a41a4501 (diff)
parente385c470ca3c58d5038d50a86380847bb6a5a56b (diff)
Merge "Reworked helper scripts and fixed typos"
Diffstat (limited to 'scripts/flush_odl.sh')
-rwxr-xr-xscripts/flush_odl.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/flush_odl.sh b/scripts/flush_odl.sh
new file mode 100755
index 0000000..11d8f80
--- /dev/null
+++ b/scripts/flush_odl.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+script_dir=$(dirname $0)
+. $script_dir/variables.sh
+
+echo "WARNING: this script doesn't install odl features; It assumes features are already configured in $ODL_ROOT/etc/org.apache.karaf.features.cfg"
+echo "WARNING: this script also doesn't configure logging; You can configure logging in $ODL_ROOT/etc/org.ops4j.pax.logging.cfg"
+echo
+
+echo "Stopping odl on all nodes"
+$script_dir/service.sh opendaylight stop
+
+echo "Waiting 10 seconds for odl to stop"
+for i in {1..10}
+do
+ echo -n "."
+ sleep 1
+done
+
+echo
+
+odl_hostnames=$(grep -Eo 'overcloud-controller-[0-9]' /etc/hosts)
+
+echo
+for odl_hostname in $odl_hostnames
+do
+ echo "Removing data, journal, snapshots and instances on $odl_hostname"
+ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $odl_hostname rm -rf $odl_dir/data $odl_dir/journal $odl_dir/snapshots $odl_dir/instances 2> /dev/null
+done
+
+echo
+
+echo "Starting odl on all nodes"
+$script_dir/service.sh opendaylight start
+
+echo "Waiting 20 seconds for odl to start"
+for i in {1..20}
+do
+ echo -n "."
+ sleep 1
+done
+
+echo
+echo
+$script_dir/remount_vpp_into_odl.sh