Untitled diff

Created Diff never expires
2 removals
67 lines
2 additions
67 lines
http://logs.openstack.org/48/588848/1/gate/tripleo-ci-centos-7-scenario001-multinode-oooq-container/75a2172/logs/undercloud/home/zuul/overcloud-deploy.sh
http://logs.openstack.org/24/567224/94/check/tripleo-ci-centos-7-scenario001-multinode-oooq-container/6307c0e/logs/undercloud/home/zuul/overcloud-deploy.sh


#!/bin/bash
#!/bin/bash


set -ux
set -ux




### --start_docs
### --start_docs
## Deploying the overcloud
## Deploying the overcloud
## =======================
## =======================


## Prepare Your Environment
## Prepare Your Environment
## ------------------------
## ------------------------


## * Source in the undercloud credentials.
## * Source in the undercloud credentials.
## ::
## ::


source /home/zuul/stackrc
source /home/zuul/stackrc




### --start_docs
### --start_docs


## * Deploy the overcloud!
## * Deploy the overcloud!
## ::
## ::
openstack overcloud deploy \
openstack overcloud deploy \
--templates /usr/share/openstack-tripleo-heat-templates \
--templates /usr/share/openstack-tripleo-heat-templates \
--libvirt-type qemu --timeout 112 -e /home/zuul/cloud-names.yaml -e /home/zuul/hostnamemap.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-environment.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-bootstrap-environment-centos.yaml --overcloud-ssh-user zuul -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml -e /home/zuul/containers-default-parameters.yaml -e /usr/share/openstack-tripleo-heat-templates/ci/environments/scenario001-multinode-containers.yaml -e /home/zuul/overcloud_network_params.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml -e /home/zuul/src/git.openstack.org/openstack//tripleo-ci/test-environments/worker-config.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/debug.yaml --validation-errors-nonfatal --roles-file /home/zuul/overcloud_roles.yaml --compute-scale 0 \
--libvirt-type qemu --timeout 106 -e /home/zuul/cloud-names.yaml -e /home/zuul/hostnamemap.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-environment.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/deployed-server-bootstrap-environment-centos.yaml --overcloud-ssh-user zuul -e /usr/share/openstack-tripleo-heat-templates/environments/docker.yaml -e /home/zuul/containers-default-parameters.yaml -e /usr/share/openstack-tripleo-heat-templates/ci/environments/scenario001-multinode-containers.yaml -e /home/zuul/overcloud_network_params.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/low-memory-usage.yaml -e /home/zuul/src/git.openstack.org/openstack//tripleo-ci/test-environments/worker-config.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/debug.yaml --validation-errors-nonfatal --roles-file /home/zuul/overcloud_roles.yaml --compute-scale 0 \
"$@" && status_code=0 || status_code=$?
"$@" && status_code=0 || status_code=$?


### --stop_docs
### --stop_docs


# Check if the deployment has started. If not, exit gracefully. If yes, check for errors.
# Check if the deployment has started. If not, exit gracefully. If yes, check for errors.
if ! openstack stack list | grep -q overcloud; then
if ! openstack stack list | grep -q overcloud; then
echo "overcloud deployment not started. Check the deploy configurations"
echo "overcloud deployment not started. Check the deploy configurations"
exit 1
exit 1


# We don't always get a useful error code from the openstack deploy command,
# 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
# so check `openstack stack list` for a CREATE_COMPLETE or an UPDATE_COMPLETE
# status.
# status.
elif ! openstack stack list | grep -Eq '(CREATE|UPDATE)_COMPLETE'; then
elif ! openstack stack list | grep -Eq '(CREATE|UPDATE)_COMPLETE'; then
# get the failures list
# get the failures list
openstack stack failures list overcloud --long > /home/zuul/failed_deployment_list.log || true
openstack stack failures list overcloud --long > /home/zuul/failed_deployment_list.log || true
# NOTE(emilien) "openstack overcloud failures" was introduced in Rocky
# NOTE(emilien) "openstack overcloud failures" was introduced in Rocky
openstack overcloud failures >> /home/zuul/failed_deployment_list.log || true
openstack overcloud failures >> /home/zuul/failed_deployment_list.log || true
# get any puppet related errors
# get any puppet related errors
for failed in $(openstack stack resource list \
for failed in $(openstack stack resource list \
--nested-depth 5 overcloud | grep FAILED |
--nested-depth 5 overcloud | grep FAILED |
grep 'StructuredDeployment ' | cut -d '|' -f3)
grep 'StructuredDeployment ' | cut -d '|' -f3)
do
do
echo "openstack software deployment show output for deployment: $failed" >> /home/zuul/failed_deployments.log
echo "openstack software deployment show output for deployment: $failed" >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
openstack software deployment show $failed >> /home/zuul/failed_deployments.log
openstack software deployment show $failed >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
echo "puppet standard error for deployment: $failed" >> /home/zuul/failed_deployments.log
echo "puppet standard error for deployment: $failed" >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
# the sed part removes color codes from the text
# the sed part removes color codes from the text
openstack software deployment show $failed -f json |
openstack software deployment show $failed -f json |
jq -r .output_values.deploy_stderr |
jq -r .output_values.deploy_stderr |
sed -r "s:\x1B\[[0-9;]*[mK]::g" >> /home/zuul/failed_deployments.log
sed -r "s:\x1B\[[0-9;]*[mK]::g" >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
echo "######################################################" >> /home/zuul/failed_deployments.log
# We need to exit with 1 because of the above || true
# We need to exit with 1 because of the above || true
done
done
exit 1
exit 1
fi
fi
exit $status_code
exit $status_code