diff --git a/scripts/te-broker/destroy-env b/scripts/te-broker/destroy-env index 9d139f1f5..ff4209c5e 100755 --- a/scripts/te-broker/destroy-env +++ b/scripts/te-broker/destroy-env @@ -32,8 +32,18 @@ function delete_ports() { } # Save the end of the bmc log for debugging IPMI connectivity problems +PYTHONIOENCODING='utf-8' +CONSOLE_LOG_PATH=/var/www/html/tebroker/console-logs/ nova console-log bmc-${ENVNUM} | tail -n 100 | awk -v envnum="$ENVNUM" '$0=envnum ": " $0' >> /var/log/bmc-console-logs +# Save all the consoles in the stack to a dedicated directory, stripping out ANSI color codes. +for server in $(openstack server list -f value -c Name | grep baremetal-${ENVNUM}) bmc-$ENVNUM +do + openstack console log show $server | sed 's/\[[0-9;]*[a-zA-Z]//g' | gzip > $CONSOLE_LOG_PATH/$server-console.log.gz || true +done + + + # Delete the ports that have been attached to the undercloud SUBNETID=$(neutron subnet-show $PUBLICNET | awk '$2=="id" {print $4}' || echo '') delete_ports $SUBNETID