Merge "Add dynamic concurrency values"

This commit is contained in:
Zuul 2020-04-02 21:40:09 +00:00 committed by Gerrit Code Review
commit e94145ce9d
6 changed files with 61 additions and 8 deletions

View File

@ -41,6 +41,15 @@
set_fact:
node_uuids_apply: "{{ node_uuids }}"
# NOTE(cloudnull): This limits the concurrency so that we're not adding
# more threads than needed.
- name: Set concurrency fact
set_fact:
runtime_concurrency: "{{
((concurrency | int) > (node_uuids_apply | length)) |
ternary((node_uuids_apply | length), (concurrency | int))
}}"
- name: exit if nothing to do
block:
- name: Notice
@ -57,11 +66,11 @@
msg: >-
Running raid config on the following nodes, {{ node_uuids_apply }}.
- name: Start baremetal bios aaply
- name: Start baremetal bios apply
os_baremetal_clean_node:
cloud: undercloud
node_uuid: "{{ node_uuids_apply }}"
concurrency: "{{ concurrency }}"
concurrency: "{{ runtime_concurrency }}"
timeout: "{{ node_timeout }}"
clean_steps:
- interface: bios

View File

@ -40,6 +40,15 @@
set_fact:
node_uuids_reset: "{{ node_uuids }}"
# NOTE(cloudnull): This limits the concurrency so that we're not adding
# more threads than needed.
- name: Set concurrency fact
set_fact:
runtime_concurrency: "{{
((concurrency | int) > (node_uuids_reset | length)) |
ternary((node_uuids_reset | length), (concurrency | int))
}}"
- name: exit if nothing to do
block:
- name: Notice
@ -60,7 +69,7 @@
os_baremetal_clean_node:
cloud: undercloud
node_uuid: "{{ node_uuids_reset }}"
concurrency: "{{ concurrency }}"
concurrency: "{{ runtime_concurrency }}"
timeout: "{{ node_timeout }}"
clean_steps:
- interface: bios

View File

@ -45,6 +45,15 @@
set_fact:
node_uuids_clean: "{{ node_uuids }}"
# NOTE(cloudnull): This limits the concurrency so that we're not adding
# more threads than needed.
- name: Set concurrency fact
set_fact:
runtime_concurrency: "{{
((concurrency | int) > (node_uuids_clean | length)) |
ternary((node_uuids_clean | length), (concurrency | int))
}}"
- name: exit if nothing to do
when:
- (node_uuids_clean | length) < 1
@ -66,7 +75,7 @@
os_baremetal_clean_node:
cloud: undercloud
node_uuid: "{{ node_uuids_clean }}"
concurrency: "{{ concurrency }}"
concurrency: "{{ runtime_concurrency }}"
# max_retries: "{{ max_retries }}" NotImplemented
timeout: "{{ node_timeout }}"
clean_steps:

View File

@ -47,6 +47,15 @@
when:
- node_uuids_intro == []
# NOTE(cloudnull): This limits the concurrency so that we're not adding
# more threads than needed.
- name: Set concurrency fact
set_fact:
runtime_concurrency: "{{
((concurrency | int) > (node_uuids_intro | length)) |
ternary((node_uuids_intro | length), (concurrency | int))
}}"
# Pre-introspection validation
- name: Run Validations
command: >
@ -60,7 +69,7 @@
auth_type: password
cloud: undercloud
node_uuids: "{{ node_uuids_intro }}"
concurrency: "{{ concurrency }}"
concurrency: "{{ runtime_concurrency }}"
max_retries: "{{ max_retries }}"
node_timeout: "{{ node_timeout }}"
register: baremetal_introspection_result

View File

@ -41,6 +41,15 @@
set_fact:
node_uuids_raid: "{{ node_uuids }}"
# NOTE(cloudnull): This limits the concurrency so that we're not adding
# more threads than needed.
- name: Set concurrency fact
set_fact:
runtime_concurrency: "{{
((concurrency | int) > (node_uuids_raid | length)) |
ternary((node_uuids_raid | length), (concurrency | int))
}}"
- name: exit if nothing to do
block:
- name: Notice
@ -61,7 +70,7 @@
os_baremetal_clean_node:
cloud: undercloud
node_uuid: "{{ node_uuids_raid }}"
concurrency: "{{ concurrency }}"
concurrency: "{{ runtime_concurrency }}"
raid_config: "{{ raid_configuration }}"
timeout: "{{ node_timeout }}"
clean_steps:

View File

@ -39,7 +39,6 @@
- baremetal_deployed_path is undefined
tasks:
- name: Detect default overcloud-full image
block:
- name: stat overcloud-full.qcow2
@ -103,6 +102,15 @@
clean_up: true
register: baremetal_reserved
# NOTE(cloudnull): This limits the concurrency so that we're not adding
# more threads than needed.
- name: Set concurrency fact
set_fact:
runtime_concurrency: "{{
((concurrency | int) > (baremetal_reserved.instances | length)) |
ternary((baremetal_reserved.instances | length), (concurrency | int))
}}"
- name: Provision instances
metalsmith_instances:
instances: "{{ baremetal_reserved.instances }}"
@ -110,7 +118,7 @@
wait: true
clean_up: false
timeout: "{{ node_timeout }}"
concurrency: "{{ concurrency }}"
concurrency: "{{ runtime_concurrency }}"
register: baremetal_provisioned
- name: Populate environment