Fix undercloud host discovery logic.

We previously spun until the ironic hosts are returned by the API then ran
discover_host once (creates host mappings).

Since If1e03c9343b8cc9c34bd51c2b4d25acdb21131ff the ironic hosts will not be
returned by the nova API until the host mappings exists.

This patch changes the logic to run discovery hosts and then check the API,
and spin until both tasks succeed.

This is a duplicate of I47a190a10ebef8eb8c2c4150635dca1c80c6cda0,
with a different depends-on as I suspect we can merge without the nova fix.

Change-Id: I10e23417417df03e1b0f78e060ba1451334a0bc6
Depends-On: If1e03c9343b8cc9c34bd51c2b4d25acdb21131ff
Closes-Bug: #1682001
This commit is contained in:
Oliver Walsh 2017-04-12 16:22:52 +01:00
parent 6cea8adf2f
commit 8386160c7b
1 changed files with 18 additions and 18 deletions

View File

@ -239,7 +239,7 @@ workflows:
tasks:
set_nodes_available:
on-success: wait_for_nova_resources
on-success: cell_v2_discover_hosts
on-error: set_status_failed_nodes_available
with-items: uuid in <% $.node_uuids %>
workflow: tripleo.baremetal.v1.set_node_state
@ -255,22 +255,6 @@ workflows:
status: FAILED
message: <% task(set_nodes_available).result %>
wait_for_nova_resources:
on-success: cell_v2_discover_hosts
on-error: wait_for_nova_resources_failed
with-items: node_uuid in <% $.node_uuids %>
action: nova.hypervisors_find hypervisor_hostname=<% $.node_uuid %>
timeout: 900 #15 minutes
retry:
delay: 30
count: 30
wait_for_nova_resources_failed:
on-success: send_message
publish:
status: FAILED
message: <% task(wait_for_nova_resources).result %>
cell_v2_discover_hosts:
on-success: try_power_off
on-error: cell_v2_discover_hosts_failed
@ -278,6 +262,10 @@ workflows:
input:
node_uuids: <% $.node_uuids %>
queue_name: <% $.queue_name %>
timeout: 900 #15 minutes
retry:
delay: 30
count: 30
cell_v2_discover_hosts_failed:
on-success: send_message
@ -812,7 +800,7 @@ workflows:
tasks:
cell_v2_discover_hosts:
on-success: send_message
on-success: wait_for_nova_resources
on-error: cell_v2_discover_hosts_failed
action: tripleo.baremetal.cell_v2_discover_hosts
@ -822,6 +810,18 @@ workflows:
status: FAILED
message: <% task(cell_v2_discover_hosts).result %>
wait_for_nova_resources:
on-success: send_message
on-error: wait_for_nova_resources_failed
with-items: node_uuid in <% $.node_uuids %>
action: nova.hypervisors_find hypervisor_hostname=<% $.node_uuid %>
wait_for_nova_resources_failed:
on-success: send_message
publish:
status: FAILED
message: <% task(wait_for_nova_resources).result %>
send_message:
action: zaqar.queue_post
retry: count=5 delay=1