Let undercloud-process-count succeed with warnings

Some services set the number of their processes equal to the number of CPUs,
which poses the risk of running out of memory in cases where this number is
very high. This validation is intended to catch these cases and therefore
breaks if the number of processes is higher than 8.

However, the validation in its current form cannot make a judgement for a
realistic limit for any given situation. This patch changes the validation so
it doesn't fail when the limit is reached but succeeds with warnings.

For a follow-up change we should investigate if increasing the limit might be
reasonable, or even if there might be some heuristics to determine the limit
dynamically based on the undercloud machine's characteristics.

Change-Id: I68e25e2a2f7f840144de7cab97731dde3aeb3694
This commit is contained in:
Florian Fuchs 2017-04-03 14:59:29 +02:00
parent 65a52d662a
commit 02000cccff
1 changed files with 10 additions and 3 deletions

View File

@ -32,7 +32,14 @@
- swift-container-server
- zaqar-server
- name: Verify the number of running processes per OpenStack service
fail: msg="There are {{ item.stdout }} {{ item.item }} processes running. Having more than {{ max_process_count }} risks running out of memory."
failed_when: "{{ item.stdout|int }} > {{ max_process_count|int }}"
- name: Create warning messages
command: echo "There are {{ item.stdout }} {{ item.item }} processes running. Having more than {{ max_process_count }} risks running out of memory."
register: process_warnings
with_items: "{{ process_count.results }}"
when: "{{ item.stdout|int }} > {{ max_process_count }}"
- name: Output warning message
warn: msg={{ warning_msg }}
when: "{{ warning_msg|length > 0}}"
vars:
warning_msg: "{{ process_warnings.results|selectattr('changed')|map(attribute='stdout')|join('\n') }}"