diff --git a/scripts/bootstrap-aio.sh b/scripts/bootstrap-aio.sh index b243953167..19b1c7ae5e 100755 --- a/scripts/bootstrap-aio.sh +++ b/scripts/bootstrap-aio.sh @@ -15,7 +15,7 @@ # limitations under the License. ## Shell Opts ---------------------------------------------------------------- -set -e -u -v -x +set -e -u -x ## Vars ---------------------------------------------------------------------- @@ -55,6 +55,9 @@ if ! [ -d $SYMLINK_DIR ] ; then exit_fail fi +# Log some data about the instance and the rest of the system +log_instance_info + # Ensure that the current kernel can support vxlan if ! modprobe vxlan; then MINIMUM_KERNEL_VERSION=$(awk '/openstack_host_required_kernel/ {print $2}' playbooks/inventory/group_vars/all.yml) @@ -265,5 +268,7 @@ if [ "${DEPLOY_SWIFT}" == "yes" ]; then sed -i "s/glance_swift_store_user:.*/glance_swift_store_user: '{{ keystone_admin_user_name }}:{{ keystone_admin_tenant_name }}'/" /etc/openstack_deploy/user_secrets.yml fi -set +x +v +# Log some data about the instance and the rest of the system +log_instance_info + info_block "The system has been prepared for an all-in-one build." diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index f46d8d78b8..9ed94f3f30 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -16,7 +16,7 @@ # (c) 2014, Kevin Carter ## Shell Opts ---------------------------------------------------------------- -set -e -u -v -x +set -e -u -x ## Vars ---------------------------------------------------------------------- diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index 15fb5608c6..89a439beca 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -14,7 +14,7 @@ # limitations under the License. ## Shell Opts ---------------------------------------------------------------- -set -e -u -v +x +set -e -u +x ## Variables ----------------------------------------------------------------- export ANSIBLE_DISABLE_COLOR=${ANSIBLE_DISABLE_COLOR:-"yes"} @@ -48,8 +48,6 @@ export TESTR_OPTS=${TESTR_OPTS:-''} info_block "Checking for required libraries." 2> /dev/null || source $(dirname ${0})/scripts-library.sh ## Main ---------------------------------------------------------------------- -# Get initial host information and reset verbosity -set +x && get_instance_info && set -x # Remove color options if [ "${ANSIBLE_DISABLE_COLOR}" == "yes" ]; then @@ -68,9 +66,6 @@ if [ "${BOOTSTRAP_ANSIBLE}" == "yes" ]; then source $(dirname ${0})/bootstrap-ansible.sh fi -# Get initial host information and reset verbosity -set +x && get_instance_info && set -x - # Run the ansible playbooks if required if [ "${RUN_PLAYBOOKS}" == "yes" ]; then # Set-up our tiny awk script. diff --git a/scripts/gate-check-lint.sh b/scripts/gate-check-lint.sh index 3c69ecec6c..6aef0bea88 100755 --- a/scripts/gate-check-lint.sh +++ b/scripts/gate-check-lint.sh @@ -14,7 +14,7 @@ # limitations under the License. ## Shell Opts ---------------------------------------------------------------- -set -e -u -v -x +set -e -u -x ## Library Check ------------------------------------------------------------- diff --git a/scripts/os-ansible-aio-check.sh b/scripts/os-ansible-aio-check.sh deleted file mode 100755 index bf137103e2..0000000000 --- a/scripts/os-ansible-aio-check.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# This is a placeholder until we change the macro for the -# os-ansible-deployment gate check script to use the -# newly split script set. - -set -e -u -v -x - -source $(dirname ${0})/gate-check-commit.sh diff --git a/scripts/run-aio-build.sh b/scripts/run-aio-build.sh index e5f8ba88f4..0ec18989cc 100755 --- a/scripts/run-aio-build.sh +++ b/scripts/run-aio-build.sh @@ -15,7 +15,7 @@ ## Shell Opts ---------------------------------------------------------------- -set -e -u -v +x +set -e -u +x ## Variables ----------------------------------------------------------------- export REPO_URL=${REPO_URL:-"https://github.com/stackforge/os-ansible-deployment.git"} diff --git a/scripts/run-playbooks.sh b/scripts/run-playbooks.sh index 70bf726d29..3d652ab5fa 100755 --- a/scripts/run-playbooks.sh +++ b/scripts/run-playbooks.sh @@ -14,7 +14,7 @@ # limitations under the License. ## Shell Opts ---------------------------------------------------------------- -set -e -u -v -x +set -e -u -x ## Variables ----------------------------------------------------------------- @@ -57,8 +57,8 @@ pushd "playbooks" # This is good when using a host with multiple times, IE: Rebuilding. ansible hosts -m shell -a 'lxc-system-manage flush-net-cache' - # Get host information post initial setup and reset verbosity - set +x && get_instance_info && set -x + # Log some data about the instance and the rest of the system + log_instance_info fi if [ "${DEPLOY_LB}" == "yes" ]; then diff --git a/scripts/run-tempest.sh b/scripts/run-tempest.sh index b5679a3017..e7c658ecf0 100755 --- a/scripts/run-tempest.sh +++ b/scripts/run-tempest.sh @@ -14,7 +14,7 @@ # limitations under the License. ## Shell Opts ---------------------------------------------------------------- -set -e -u -v +x +set -e -u +x ## Vars ---------------------------------------------------------------------- diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index 767f4e014c..9bfb7e2827 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -204,19 +204,29 @@ function info_block(){ echo "${LINE}" } +function log_instance_info() { + set +x + # Get host information post initial setup and reset verbosity + if [ ! -d "/openstack/log/instance-info" ];then + mkdir -p "/openstack/log/instance-info" + fi + get_instance_info &> /openstack/log/instance-info/host_info_$(date +%s).log + set -x +} + # Get instance info function get_instance_info() { set +x info_block 'Available Memory' - free -mt + free -mt || true info_block 'Available Disk Space' - df -h + df -h || true info_block 'Mounted Devices' - mount + mount || true info_block 'Block Devices' - lsblk + lsblk || true info_block 'Block Devices Information' - blkid + blkid || true info_block 'Block Device Partitions' for i in /dev/xv* /dev/sd* /dev/vd*; do if [ -b "$i" ];then @@ -224,27 +234,27 @@ function get_instance_info() { fi done info_block 'PV Information' - pvs + pvs || true info_block 'VG Information' - vgs + vgs || true info_block 'LV Information' - lvs + lvs || true info_block 'CPU Information' - which lscpu && lscpu + which lscpu && lscpu || true info_block 'Kernel Information' - uname -a + uname -a || true info_block 'Container Information' - which lxc-ls && lxc-ls --fancy + which lxc-ls && lxc-ls --fancy || true info_block 'Firewall Information' - iptables -vnL - iptables -t nat -vnL - iptables -t mangle -vnL + iptables -vnL || true + iptables -t nat -vnL || true + iptables -t mangle -vnL || true info_block 'Network Devices' - ip a + ip a || true info_block 'Network Routes' - ip r + ip r || true info_block 'Trace Path from google' - tracepath 8.8.8.8 -m 5 + tracepath 8.8.8.8 -m 5 || true info_block 'XEN Server Information' if (which xenstore-read);then xenstore-read vm-data/provider_data/provider || echo "\nxenstore Read Failed - Skipping\n"