46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
---
|
|
- hosts: undercloud
|
|
vars:
|
|
metadata:
|
|
name: Check the number of OpenStack processes on undercloud
|
|
description: >
|
|
The default settings for OpenStack is to run one process (heat-engine,
|
|
keystone, etc.) per CPU core. On a machine with a lot of cores this is
|
|
both unnecessary and can consume a significant amount of RAM, leading
|
|
to crashes due to OOMKiller.
|
|
groups:
|
|
- pre-deployment
|
|
max_process_count: 8
|
|
tasks:
|
|
- name: Collect the number of running processes per OpenStack service
|
|
command: pgrep -f -c {{ item }}
|
|
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
|
|
|
|
- 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') }}"
|