Fix the undercloud-process-count validation

After containerization of several services the `pgrep` call which should return
the number of running processes doesn't work anymore (since it's executed
outside of the container where the service is running)

This patch executes the `pgrep` command inside of the appropriate container.

Note: The validation in its current form cannot make a judgement for a
realistic limit for any given situation. For that reason, this validation will
always succeed with warning(s).

Change-Id: I0cb33babae2fc285fff7fd6638c578b39e630338
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud 2018-11-09 12:27:03 +01:00
parent 2bb0d1c441
commit dd97924720
1 changed files with 18 additions and 15 deletions

View File

@ -13,24 +13,27 @@
max_process_count: 8
tasks:
- name: Collect the number of running processes per OpenStack service
command: pgrep -f -c {{ item }}
command: 'docker exec {{ item|replace("-","_") }} pgrep -f -c {{ item }}'
become: true
ignore_errors: yes
register: "process_count"
changed_when: False
with_items:
- heat-engine
- mistral
- ironic-inspector
- ironic-conductor
- nova-api
- nova-scheduler
- nova-conductor
- nova-compute
- glance-api
- swift-proxy-server
- swift-object-server
- swift-container-server
- zaqar-server
loop:
- heat-engine
- mistral-api
- mistral-engine
- mistral-executor
- ironic-inspector
- ironic-conductor
- nova-api
- nova-scheduler
- nova-conductor
- nova-compute
- glance-api
- swift-proxy
- swift-object-server
- swift-container-server
- zaqar
- 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."