Aggregate deployment logs of overcloud 87/9587/2
authorMichael Chapman <woppin@gmail.com>
Tue, 9 Feb 2016 05:55:27 +0000 (16:55 +1100)
committerMichael Chapman <woppin@gmail.com>
Tue, 9 Feb 2016 12:29:10 +0000 (23:29 +1100)
JIRA: APEX-74

/var/log/messages for each node will be slurped into a new folder in the
stack user's home directory. If debug was passed, it will also be printed
out along with the nova list for that node.

Change-Id: I726da67b076bdf1fb38ba1805456cbd7c7d9e096

ci/deploy.sh

index 2e3bea7..8dc9d7f 100755 (executable)
@@ -985,6 +985,34 @@ EOF
 done
 EOI
   fi
+
+  # Collect deployment logs
+  ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
+mkdir -p ~/deploy_logs
+rm -rf deploy_logs/*
+source stackrc
+set -o errexit
+for node in \$(nova list | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"); do
+ ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
+ sudo cp /var/log/messages /home/heat-admin/messages.log
+ sudo chown heat-admin /home/heat-admin/messages.log
+EOF
+scp ${SSH_OPTIONS[@]} heat-admin@\$node:/home/heat-admin/messages.log ~/deploy_logs/\$node.messages.log
+if [ \$debug == "TRUE" ]; then
+    nova list --ip \$node
+    echo "---------------------------"
+    echo "-----/var/log/messages-----"
+    echo "---------------------------"
+    cat ~/deploy_logs/\$node.messages.log
+    echo "---------------------------"
+    echo "----------END LOG----------"
+    echo "---------------------------"
+fi
+ ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" <<EOF
+ sudo rm -f /home/heat-admin/messages.log
+EOF
+done
+EOI
 }
 
 display_usage() {