#!/bin/bash set -ux ### --start_docs ## Deploying the overcloud ## ======================= ## Prepare Your Environment ## ------------------------ ## * Source in the undercloud credentials. ## :: source /home/zuul/stackrc ### --stop_docs # Wait until there are hypervisors available. while true; do count=$(openstack hypervisor stats show -c count -f value) if [ $count -gt 0 ]; then break fi done ### --start_docs ## * Deploy the overcloud! ## :: openstack overcloud deploy --override-ansible-cfg /home/zuul/custom_ansible.cfg \ --templates /usr/share/openstack-tripleo-heat-templates \ --libvirt-type qemu --timeout 120 --ntp-server 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org -e /home/zuul/cloud-names.yaml -e /home/zuul/neutronl3ha.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/docker-ha.yaml -e /home/zuul/containers-default-parameters.yaml -e /usr/share/openstack-tripleo-heat-templates/ci/environments/network/multiple-nics/network-isolation-absolute.yaml -e /usr/share/openstack-tripleo-heat-templates/ci/environments/network/multiple-nics/network-environment.yaml -e /home/zuul/overcloud_network_params.yaml -e /home/zuul/overcloud_storage_params.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml -e /home/zuul/src/opendev.org/openstack/tripleo-ci/test-environments/worker-config.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/debug.yaml -e /home/zuul/inject-trust-anchor.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/disable-telemetry.yaml --validation-errors-nonfatal -e /home/zuul/overcloud-topology-config.yaml -e /home/zuul/overcloud-selinux-config.yaml \ "$@" && status_code=0 || status_code=$? ### --stop_docs # Check if the deployment has started. If not, exit gracefully. If yes, check for errors. if ! openstack stack list | grep -q overcloud; then echo "overcloud deployment not started. Check the deploy configurations" exit 1 # We don't always get a useful error code from the openstack deploy command, # so check `openstack stack list` for a CREATE_COMPLETE or an UPDATE_COMPLETE # status. elif ! openstack stack list | grep -Eq '(CREATE|UPDATE)_COMPLETE'; then # get the failures list openstack stack failures list overcloud --long > /home/zuul/failed_deployment_list.log || true # get any puppet related errors for failed in $(openstack stack resource list \ --nested-depth 5 overcloud | grep FAILED | grep 'StructuredDeployment ' | cut -d '|' -f3) do echo "openstack software deployment show output for deployment: $failed" >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/failed_deployments.log openstack software deployment show $failed >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/failed_deployments.log echo "puppet standard error for deployment: $failed" >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/failed_deployments.log # the sed part removes color codes from the text openstack software deployment show $failed -f json | jq -r .output_values.deploy_stderr | sed -r "s:\x1B\[[0-9;]*[mK]::g" >> /home/zuul/failed_deployments.log echo "######################################################" >> /home/zuul/failed_deployments.log # We need to exit with 1 because of the above || true done exit 1 elif ! openstack overcloud status | grep -Eq 'DEPLOY_SUCCESS'; then # NOTE(emilien) "openstack overcloud failures" was introduced in Rocky openstack overcloud failures >> /home/zuul/failed_deployment_list.log || true fi exit $status_code