Get logs and config from bootstrap node
This commit is contained in:
parent
1c2135d983
commit
2adeecd820
|
@ -42,3 +42,9 @@ apply_patches(){
|
|||
mark_time(){
|
||||
echo $(date) : $@
|
||||
}
|
||||
|
||||
# Get config files and logs from a host for debuging purposes
|
||||
get_state_from_host(){
|
||||
ssh_noprompt root@$BOOTSTRAP_IP "( set -x ; ps -ef ; df -h ; uptime ; netstat -lpn ; iptables-save ; brctl show ; ip addr) > /var/log/host_info.txt 2>&1 ;
|
||||
tar -czf - /var/log /etc" > $TOCI_LOG_DIR/bootstraplogs.tgz
|
||||
}
|
||||
|
|
|
@ -44,6 +44,10 @@ DIB_PATH=$TOCI_WORKING_DIR/stackforge_diskimage-builder \
|
|||
scripts/boot-elements boot-stack -o bootstrap
|
||||
|
||||
BOOTSTRAP_IP=`scripts/get-vm-ip bootstrap`
|
||||
|
||||
# Get logs from the node on error
|
||||
trap get_state_from_host ERR
|
||||
|
||||
# We're going to wait for it to finish firstboot
|
||||
wait_for 60 10 ssh_noprompt root@$BOOTSTRAP_IP ls /opt/stack/boot-stack/boot-stack.done
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ set -xe
|
|||
cd $TOCI_WORKING_DIR/tripleo_incubator
|
||||
BOOTSTRAP_IP=`scripts/get-vm-ip bootstrap`
|
||||
|
||||
# Get logs from the node on exit
|
||||
trap get_state_from_host EXIT
|
||||
|
||||
scp_noprompt root@$BOOTSTRAP_IP:stackrc $TOCI_WORKING_DIR/stackrc
|
||||
sed -i "s/localhost/$BOOTSTRAP_IP/" $TOCI_WORKING_DIR/stackrc
|
||||
source $TOCI_WORKING_DIR/stackrc
|
||||
|
|
Loading…
Reference in New Issue