From 697bb2d2b33678e6b637df50992428fde57ae248 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Mon, 7 Dec 2015 08:56:12 -0500 Subject: [PATCH] Support to wait for node deployment to complete The original os_ironic_node module, nor bifrost as a whole lacks a concept of waiting for a node deployment to reach an active state where the conductor no longer has to take any additional action upon the node. In order to allow users to utilize the Ansible serial option, we need to support the ability to wait so the conductor is not overloaded by the user in specific edge cases. Change-Id: I1fe3353a56a54ecde25f9f237b85ca009813f541 Depends-On: I69eee2d254cde2fffcf0c1ac7679a623fa7f97a5 --- playbooks/inventory/group_vars/baremetal | 7 +++++++ .../roles/bifrost-deploy-nodes-dynamic/defaults/main.yml | 8 ++++++++ .../roles/bifrost-deploy-nodes-dynamic/tasks/main.yml | 2 ++ scripts/test-bifrost.sh | 2 ++ 4 files changed, 19 insertions(+) diff --git a/playbooks/inventory/group_vars/baremetal b/playbooks/inventory/group_vars/baremetal index ef434ba1c..575a06c42 100644 --- a/playbooks/inventory/group_vars/baremetal +++ b/playbooks/inventory/group_vars/baremetal @@ -42,3 +42,10 @@ testing_user: root # will be generated using diskimage-builder. # deploy_image_filename: "deployment_image.qcow2" # deploy_image: "{{http_boot_folder}}/{{deploy_image_filename}}" + +# Under normal circumstances, the os_ironic_node module does not wait for +# the node to reach active state before continuing with the deployment +# process. This means we may have to timeout, to figure out a deployment +# failed. Change wait_for_node_deploy to true to cause bifrost to wait for +# Ironic to show the instance in Active state. +wait_for_node_deploy: false diff --git a/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml b/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml index 759aedf6a..9dc66eddf 100644 --- a/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml +++ b/playbooks/roles/bifrost-deploy-nodes-dynamic/defaults/main.yml @@ -14,3 +14,11 @@ inventory_dhcp_static_ip: true inventory_dns: false deploy_url_protocol: "http" noauth_mode: true + +# Under normal circumstances, the os_ironic_node module does not wait for +# the node to reach active state before continuing with the deployment +# process. This means we may have to timeout, to figure out a deployment +# failed. Change wait_for_node_deploy to true to cause bifrost to wait for +# Ironic to show the instance in Active state. +wait_for_node_deploy: false +wait_timeout: 1800 diff --git a/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml b/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml index 14b135c24..65551a32f 100644 --- a/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml +++ b/playbooks/roles/bifrost-deploy-nodes-dynamic/tasks/main.yml @@ -95,5 +95,7 @@ image_checksum: "{{ test_deploy_image.stat.md5 }}" image_disk_format: "qcow2" root_gb: 10 + wait: "{{ wait_for_node_deploy }}" + timeout: " {{ wait_timeout | default(1800) }}" delegate_to: localhost when: instance_info is not defined or ( instance_info is defined and instance_info | to_json == '{}' ) diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index 341bd13f7..d8368015d 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -39,6 +39,7 @@ PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-900} NOAUTH_MODE=true ENABLE_KEYSTONE=false CLOUD_CONFIG="" +WAIT_FOR_DEPLOY=true # NOTE(cinerama): We could remove this if we change the CI job to use # USE_DHCP, BUILD_IMAGE, etc. @@ -148,6 +149,7 @@ ${ANSIBLE} -vvvv \ -e wait_timeout=${PROVISION_WAIT_TIMEOUT} \ -e noauth_mode=${NOAUTH_MODE} \ -e enable_keystone=${ENABLE_KEYSTONE} \ + -e wait_for_node_deploy=${WAIT_FOR_DEPLOY} \ ${CLOUD_CONFIG} EXITCODE=$?