Apply Resource Constraints to Openstack Services

This commit is to apply resource-constraints only to few OpenStack services.
Commit to apply constraints to other services will be made in coming commits.

Partially-Implements: blueprint resource-constraints

Change-Id: Icafa54baca24d2de64238222a5677b9d8b90e2aa
This commit is contained in:
Lakshmi Prasanna Goutham Pratapa 2018-07-13 19:17:53 +05:30 committed by Mark Goddard
parent 97dcee4c98
commit 76210a2d85
61 changed files with 323 additions and 8 deletions

View File

@ -301,7 +301,8 @@ class DockerWorker(object):
self.compare_volumes(container_info) or
self.compare_volumes_from(container_info) or
self.compare_environment(container_info) or
self.compare_container_state(container_info)
self.compare_container_state(container_info) or
self.compare_dimensions(container_info)
)
def compare_ipc_mode(self, container_info):
@ -438,6 +439,36 @@ class DockerWorker(object):
if new_state != current_state:
return True
def compare_dimensions(self, container_info):
new_dimensions = self.params.get('dimensions')
# NOTE(mgoddard): The names used by Docker are inconsisent between
# configuration of a container's resources and the resources in
# container_info['HostConfig']. This provides a mapping between the
# two.
dimension_map = {
'mem_limit': 'Memory', 'mem_reservation': 'MemoryReservation',
'memswap_limit': 'MemorySwap', 'cpu_period': 'CpuPeriod',
'cpu_quota': 'CpuQuota', 'cpu_shares': 'CpuShares',
'cpuset_cpus': 'CpusetCpus', 'cpuset_mems': 'CpusetMems',
'kernel_memory': 'KernelMemory', 'blkio_weight': 'BlkioWeight'}
unsupported = set(new_dimensions.keys()) - \
set(dimension_map.keys())
if unsupported:
self.module.exit_json(
failed=True, msg=repr("Unsupported dimensions"),
unsupported_dimensions=unsupported)
current_dimensions = container_info['HostConfig']
for key1, key2 in dimension_map.items():
# NOTE(mgoddard): If a resource has been explicitly requested,
# check for a match. Otherwise, ensure is is set to the default.
if key1 in new_dimensions:
if new_dimensions[key1] != current_dimensions[key2]:
return True
elif current_dimensions[key2]:
# The default values of all currently supported resources are
# '' or 0 - both falsey.
return True
def parse_image(self):
full_image = self.params.get('image')

View File

@ -13,6 +13,7 @@ aodh_services:
- "aodh:/var/lib/aodh/"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python2.7/site-packages/aodh' if aodh_dev_mode | bool else '' }}"
dimensions: "{{ aodh_api_dimensions }}"
aodh-evaluator:
container_name: aodh_evaluator
group: aodh-evaluator
@ -23,6 +24,7 @@ aodh_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python2.7/site-packages/aodh' if aodh_dev_mode | bool else '' }}"
dimensions: "{{ aodh_evaluator_dimensions }}"
aodh-listener:
container_name: aodh_listener
group: aodh-listener
@ -33,6 +35,7 @@ aodh_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python2.7/site-packages/aodh' if aodh_dev_mode | bool else '' }}"
dimensions: "{{ aodh_listener_dimensions }}"
aodh-notifier:
container_name: aodh_notifier
group: aodh-notifier
@ -43,6 +46,7 @@ aodh_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/aodh/aodh:/var/lib/kolla/venv/lib/python2.7/site-packages/aodh' if aodh_dev_mode | bool else '' }}"
dimensions: "{{ aodh_notifier_dimensions }}"
####################
@ -74,6 +78,10 @@ aodh_notifier_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ d
aodh_notifier_tag: "{{ aodh_tag }}"
aodh_notifier_image_full: "{{ aodh_notifier_image }}:{{ aodh_notifier_tag }}"
aodh_api_dimensions: "{{ default_container_dimensions }}"
aodh_evaluator_dimensions: "{{ default_container_dimensions }}"
aodh_listener_dimensions: "{{ default_container_dimensions }}"
aodh_notifier_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -39,6 +40,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -63,6 +65,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -87,6 +90,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -111,6 +111,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_aodh_containers
when:
- kolla_action != "config"

View File

@ -13,6 +13,7 @@ barbican_services:
- "barbican:/var/lib/barbican/"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/barbican/barbican:/var/lib/kolla/venv/lib/python2.7/site-packages/barbican' if barbican_dev_mode | bool else '' }}"
dimensions: "{{ barbican_api_dimensions }}"
barbican-keystone-listener:
container_name: barbican_keystone_listener
group: barbican-keystone-listener
@ -23,6 +24,7 @@ barbican_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/barbican/barbican:/var/lib/kolla/venv/lib/python2.7/site-packages/barbican' if barbican_dev_mode | bool else '' }}"
dimensions: "{{ barbican_keystone_listener_dimensions }}"
barbican-worker:
container_name: barbican_worker
group: barbican-worker
@ -33,6 +35,7 @@ barbican_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/barbican/barbican:/var/lib/kolla/venv/lib/python2.7/site-packages/barbican' if barbican_dev_mode | bool else '' }}"
dimensions: "{{ barbican_worker_dimensions }}"
####################
@ -61,6 +64,9 @@ barbican_worker_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{
barbican_worker_tag: "{{ barbican_tag }}"
barbican_worker_image_full: "{{ barbican_worker_image }}:{{ barbican_worker_tag }}"
barbican_api_dimensions: "{{ default_container_dimensions }}"
barbican_keystone_listener_dimensions: "{{ default_container_dimensions }}"
barbican_worker_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -40,6 +41,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -64,6 +66,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -130,6 +130,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_barbican_containers
when:
- kolla_action != "config"

View File

@ -12,6 +12,7 @@ blazar_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python2.7/site-packages/blazar' if blazar_dev_mode | bool else '' }}"
dimensions: "{{ blazar_api_dimensions }}"
blazar-manager:
container_name: blazar_manager
group: blazar-manager
@ -22,6 +23,7 @@ blazar_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python2.7/site-packages/blazar' if blazar_dev_mode | bool else '' }}"
dimensions: "{{ blazar_manager_dimensions }}"
####################
@ -51,6 +53,8 @@ blazar_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ dock
blazar_api_tag: "{{ blazar_tag }}"
blazar_api_image_full: "{{ blazar_api_image }}:{{ blazar_api_tag }}"
blazar_api_dimensions: "{{ default_container_dimensions }}"
blazar_manager_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -38,6 +39,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -89,6 +89,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_blazar_containers
when:
- kolla_action != "config"

View File

@ -12,6 +12,7 @@ ceilometer_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python2.7/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}"
dimensions: "{{ ceilometer_notification_dimensions }}"
ceilometer-central:
container_name: ceilometer_central
group: ceilometer-central
@ -23,6 +24,7 @@ ceilometer_services:
- "ceilometer:/var/lib/ceilometer/"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python2.7/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}"
dimensions: "{{ ceilometer_central_dimensions }}"
ceilometer-compute:
container_name: ceilometer_compute
group: ceilometer-compute
@ -37,6 +39,7 @@ ceilometer_services:
- "kolla_logs:/var/log/kolla/"
- "nova_libvirt:/var/lib/libvirt"
- "{{ kolla_dev_repos_directory ~ '/ceilometer/ceilometer:/var/lib/kolla/venv/lib/python2.7/site-packages/ceilometer' if ceilometer_dev_mode | bool else '' }}"
dimensions: "{{ ceilometer_compute_dimensions }}"
####################
@ -57,6 +60,9 @@ ceilometer_compute_image: "{{ docker_registry ~ '/' if docker_registry else '' }
ceilometer_compute_tag: "{{ ceilometer_tag }}"
ceilometer_compute_image_full: "{{ ceilometer_compute_image }}:{{ ceilometer_compute_tag }}"
ceilometer_notification_dimensions: "{{ default_container_dimensions }}"
ceilometer_central_dimensions: "{{ default_container_dimensions }}"
ceilometer_compute_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack

View File

@ -17,6 +17,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -46,6 +47,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -74,6 +76,7 @@
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -196,6 +196,7 @@
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes | reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_ceilometer_containers
when:
- kolla_action != "config"

View File

@ -12,6 +12,7 @@ chrony_services:
- "{{ node_config_directory }}/chrony/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla"
dimensions: "{{ chrony_dimensions }}"
chrony_bindaddress: "{{ kolla_internal_vip_address }}"
@ -21,3 +22,5 @@ chrony_bindaddress: "{{ kolla_internal_vip_address }}"
chrony_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-chrony"
chrony_tag: "{{ openstack_release }}"
chrony_image_full: "{{ chrony_image }}:{{ chrony_tag }}"
chrony_dimensions: "{{ default_container_dimensions }}"

View File

@ -11,6 +11,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -43,6 +43,7 @@
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[item.value.group]

View File

@ -12,6 +12,7 @@ cinder_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
dimensions: "{{ cinder_api_dimensions }}"
cinder-scheduler:
container_name: cinder_scheduler
group: cinder-scheduler
@ -22,6 +23,7 @@ cinder_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
dimensions: "{{ cinder_scheduler_dimensions }}"
cinder-volume:
container_name: cinder_volume
group: cinder-volume
@ -39,6 +41,7 @@ cinder_services:
- "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
dimensions: "{{ cinder_volume_dimensions }}"
cinder-backup:
container_name: cinder_backup
group: cinder-backup
@ -54,6 +57,7 @@ cinder_services:
- "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
dimensions: "{{ cinder_backup_dimensions }}"
####################
# Ceph
@ -129,6 +133,10 @@ cinder_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ dock
cinder_api_tag: "{{ cinder_tag }}"
cinder_api_image_full: "{{ cinder_api_image }}:{{ cinder_api_tag }}"
cinder_api_dimensions: "{{ default_container_dimensions }}"
cinder_backup_dimensions: "{{ default_container_dimensions }}"
cinder_scheduler_dimensions: "{{ default_container_dimensions }}"
cinder_volume_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -39,6 +40,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -65,6 +67,7 @@
privileged: "{{ service.privileged | default(False) }}"
ipc_mode: "{{ service.ipc_mode | default('') }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -90,6 +93,7 @@
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -127,6 +127,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
dimensions: "{{ item.value.dimensions }}"
privileged: "{{ item.value.privileged | default(False) }}"
ipc_mode: "{{ item.value.ipc_mode | default('') }}"
register: check_cinder_containers

View File

@ -12,6 +12,7 @@ cloudkitty_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cloudkitty/cloudkitty:/var/lib/kolla/venv/lib/python2.7/site-packages/cloudkitty' if cloudkitty_dev_mode | bool else '' }}"
dimensions: "{{ cloudkitty_api_dimensions }}"
cloudkitty-processor:
container_name: "cloudkitty_processor"
group: "cloudkitty-processor"
@ -22,6 +23,7 @@ cloudkitty_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cloudkitty/cloudkitty:/var/lib/kolla/venv/lib/python2.7/site-packages/cloudkitty' if cloudkitty_dev_mode | bool else '' }}"
dimensions: "{{ cloudkitty_processor_dimensions }}"
####################
@ -46,6 +48,10 @@ cloudkitty_processor_image: "{{ docker_registry ~ '/' if docker_registry else ''
cloudkitty_processor_tag: "{{ cloudkitty_tag }}"
cloudkitty_processor_image_full: "{{ cloudkitty_processor_image }}:{{ cloudkitty_processor_tag }}"
cloudkitty_processor_diensions: "{{ default_container_dimensions }}"
cloudkitty_api_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack
####################

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -39,6 +40,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -105,6 +105,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_cloudkitty_containers
when:
- kolla_action != "config"

View File

@ -13,6 +13,7 @@ collectd_services:
- "kolla_logs:/var/log/kolla/"
- "/sys/:/sys/:ro"
- "/dev/:/dev/:ro"
dimensions: "{{ collectd_dimensions }}"
####################
# Docker
@ -21,6 +22,8 @@ collectd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker
collectd_tag: "{{ openstack_release }}"
collectd_image_full: "{{ collectd_image }}:{{ collectd_tag }}"
collectd_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack
####################

View File

@ -13,6 +13,7 @@
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -68,6 +68,7 @@
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged | default(False) }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
register: check_collectd_containers
when:
- kolla_action != "config"

View File

@ -14,6 +14,7 @@ common_services:
- "{{ node_config_directory }}/fluentd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ fluentd_dimensions }}"
kolla-toolbox:
container_name: kolla_toolbox
enabled: True
@ -28,6 +29,7 @@ common_services:
- "/dev/:/dev/"
- "/run/:/run/:shared"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ kolla_toolbox_dimensions }}"
# DUMMY_ENVIRONMENT is needed because empty environment is not supported
cron:
container_name: cron
@ -39,6 +41,7 @@ common_services:
- "{{ node_config_directory }}/cron/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ cron_dimensions }}"
####################
@ -47,6 +50,10 @@ common_services:
common_install_type: "{{ kolla_install_type }}"
common_tag: "{{ openstack_release }}"
cron_dimensions: "{{ default_container_dimensions }}"
kolla_toolbox_dimensions: "{{ default_container_dimensions }}"
fluentd_dimensions: "{{ default_container_dimensions }}"
kolla_toolbox_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ common_install_type }}-kolla-toolbox"
kolla_toolbox_tag: "{{ common_tag }}"
kolla_toolbox_image_full: "{{ kolla_toolbox_image }}:{{ kolla_toolbox_tag }}"

View File

@ -13,6 +13,7 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
environment: "{{ service.environment }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- service.enabled | bool
@ -41,6 +42,7 @@
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
environment: "{{ service.environment }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- service.enabled | bool
@ -67,6 +69,7 @@
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
environment: "{{ service.environment }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- service.enabled | bool

View File

@ -255,6 +255,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
privileged: "{{ item.value.privileged | default(False) }}"
environment: "{{ item.value.environment }}"
register: check_common_containers

View File

@ -12,6 +12,7 @@ congress_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/congress/congress:/var/lib/kolla/venv/lib/python2.7/site-packages/congress' if congress_dev_mode | bool else '' }}"
dimensions: "{{ congress_api_dimensions }}"
congress-policy-engine:
container_name: congress_policy_engine
group: congress-policy-engine
@ -22,6 +23,7 @@ congress_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/congress/congress:/var/lib/kolla/venv/lib/python2.7/site-packages/congress' if congress_dev_mode | bool else '' }}"
dimensions: "{{ congress_policy_engine_dimensions }}"
congress-datasource:
container_name: congress_datasource
group: congress-datasource
@ -32,6 +34,7 @@ congress_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/congress/congress:/var/lib/kolla/venv/lib/python2.7/site-packages/congress' if congress_dev_mode | bool else '' }}"
dimensions: "{{ congress_datasource_dimensions }}"
####################
@ -60,6 +63,9 @@ congress_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ do
congress_api_tag: "{{ congress_tag }}"
congress_api_image_full: "{{ congress_api_image }}:{{ congress_api_tag }}"
congress_api_dimensions: "{{ default_container_dimensions }}"
congress_policy_engine_dimensions: "{{ default_container_dimensions }}"
congress_datasource_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -38,6 +39,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -62,6 +64,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -87,6 +87,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_congress_containers
when:
- kolla_action != "config"

View File

@ -12,6 +12,7 @@ designate_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
dimensions: "{{ designate_api_dimensions }}"
designate-backend-bind9:
container_name: designate_backend_bind9
group: designate-backend-bind9
@ -22,6 +23,7 @@ designate_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "designate_backend_bind9:/var/lib/named/"
dimensions: "{{ designate_backend_bind9_dimensions }}"
designate-central:
container_name: designate_central
group: designate-central
@ -32,6 +34,7 @@ designate_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
dimensions: "{{ designate_central_dimensions }}"
designate-mdns:
container_name: designate_mdns
group: designate-mdns
@ -42,6 +45,7 @@ designate_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
dimensions: "{{ designate_mdns_dimensions }}"
designate-producer:
container_name: designate_producer
group: designate-producer
@ -52,6 +56,7 @@ designate_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
dimensions: "{{ designate_producer_dimensions }}"
designate-worker:
container_name: designate_worker
group: designate-worker
@ -62,6 +67,7 @@ designate_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
dimensions: "{{ designate_worker_dimensions }}"
designate-sink:
container_name: designate_sink
group: designate-sink
@ -72,6 +78,7 @@ designate_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
dimensions: "{{ designate_sink_dimensions }}"
####################
@ -120,6 +127,14 @@ designate_worker_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{
designate_worker_tag: "{{ designate_tag }}"
designate_worker_image_full: "{{ designate_worker_image }}:{{ designate_worker_tag }}"
designate_api_dimensions: "{{ default_container_dimensions }}"
designate_backend_bind9_dimensions: "{{ default_container_dimensions }}"
designate_central_dimensions: "{{ default_container_dimensions }}"
designate_mdns_dimensions: "{{ default_container_dimensions }}"
designate_producer_dimensions: "{{ default_container_dimensions }}"
designate_worker_dimensions: "{{ default_container_dimensions }}"
designate_sink_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack
####################

View File

@ -12,6 +12,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -37,6 +38,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -61,6 +63,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -85,6 +88,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -109,6 +113,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -133,6 +138,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -159,6 +165,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -184,6 +184,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_designate_containers
when:
- kolla_action != "config"

View File

@ -11,6 +11,7 @@ elasticsearch_services:
- "{{ node_config_directory }}/elasticsearch/:{{ container_config_directory }}/"
- "/etc/localtime:/etc/localtime:ro"
- "elasticsearch:/var/lib/elasticsearch/data"
dimensions: "{{ elasticsearch_dimensions }}"
####################
@ -26,3 +27,5 @@ es_java_opts: "{% if es_heap_size %}-Xms{{ es_heap_size }} -Xmx{{ es_heap_size }
elasticsearch_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-elasticsearch"
elasticsearch_tag: "{{ openstack_release }}"
elasticsearch_image_full: "{{ elasticsearch_image }}:{{ elasticsearch_tag }}"
elasticsearch_dimensions: "{{ default_container_dimensions }}"

View File

@ -14,6 +14,7 @@
image: "{{ service.image }}"
environment: "{{ service.environment }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -57,6 +57,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment }}"
register: check_elasticsearch_containers
when:

View File

@ -29,6 +29,7 @@ etcd_services:
- "/etc/localtime:/etc/localtime:ro"
- "kolla_etcd:/var/lib/etcd/"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ etcd_dimensions }}"
####################
@ -37,3 +38,4 @@ etcd_services:
etcd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-etcd"
etcd_tag: "{{ openstack_release }}"
etcd_image_full: "{{ etcd_image }}:{{ etcd_tag }}"
etcd_dimensions: "{{ default_container_dimensions }}"

View File

@ -13,6 +13,7 @@
image: "{{ service.image }}"
environment: "{{ service.environment }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- service.enabled | bool

View File

@ -34,6 +34,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
environment: "{{ item.value.environment }}"
register: check_etcd_containers
when:

View File

@ -12,6 +12,7 @@ freezer_services:
- "/etc/localtime:/etc/localtime:ro"
- "freezer:/var/lib/freezer/"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ freezer_api_dimensions }}"
freezer-scheduler:
container_name: freezer_scheduler
group: freezer-scheduler
@ -22,6 +23,7 @@ freezer_services:
- "/etc/localtime:/etc/localtime:ro"
- "freezer:/var/lib/freezer/"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ freezer_scheduler_dimensions }}"
####################
@ -38,6 +40,9 @@ freezer_scheduler_image: "{{ docker_registry ~ '/' if docker_registry else '' }}
freezer_scheduler_tag: "{{ freezer_tag }}"
freezer_scheduler_image_full: "{{ freezer_scheduler_image }}:{{ freezer_scheduler_tag }}"
freezer_api_dimensions: "{{ default_container_dimensions }}"
freezer_scheduler_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack
####################

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -39,6 +40,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -102,6 +102,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
register: check_freezer_containers
when:
- kolla_action != "config"

View File

@ -14,6 +14,7 @@ glance_services:
- "{{ glance_file_datadir_volume }}:/var/lib/glance/"
- "{{ kolla_dev_repos_directory ~ '/glance/glance:/var/lib/kolla/venv/lib/python2.7/site-packages/glance' if glance_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ glance_api_dimensions }}"
glance-registry:
container_name: glance_registry
group: glance-registry
@ -24,6 +25,7 @@ glance_services:
- "/etc/localtime:/etc/localtime:ro"
- "{{ kolla_dev_repos_directory ~ '/glance/glance:/var/lib/kolla/venv/lib/python2.7/site-packages/glance' if glance_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ glance_registry_dimensions }}"
####################
# Notification
@ -78,6 +80,10 @@ glance_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ dock
glance_api_tag: "{{ glance_tag }}"
glance_api_image_full: "{{ glance_api_image }}:{{ glance_api_tag }}"
glance_api_dimensions: "{{ default_container_dimensions }}"
glance_registry_dimensions: "{{ default_container_dimensions }}"
####################
# Glance
####################

View File

@ -15,6 +15,7 @@
image: "{{ service.image }}"
environment: "{{ service.environment }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in glance_api_hosts
@ -41,6 +42,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -120,6 +120,7 @@
image: "{{ item.value.image }}"
environment: "{{ item.value.environment | default(omit) }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_glance_containers
when:
- kolla_action != "config"

View File

@ -12,6 +12,7 @@ gnocchi_services:
- "/etc/localtime:/etc/localtime:ro"
- "gnocchi:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ gnocchi_api_dimensions }}"
gnocchi-metricd:
container_name: gnocchi_metricd
group: gnocchi-metricd
@ -22,6 +23,7 @@ gnocchi_services:
- "/etc/localtime:/etc/localtime:ro"
- "gnocchi:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ gnocchi_metricd_dimensions }}"
gnocchi-statsd:
container_name: gnocchi_statsd
group: gnocchi-statsd
@ -32,6 +34,7 @@ gnocchi_services:
- "/etc/localtime:/etc/localtime:ro"
- "gnocchi:/var/lib/gnocchi/"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ gnocchi_statsd_dimensions }}"
####################
@ -82,6 +85,10 @@ gnocchi_metricd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{
gnocchi_metricd_tag: "{{ gnocchi_tag }}"
gnocchi_metricd_image_full: "{{ gnocchi_metricd_image }}:{{ gnocchi_metricd_tag }}"
gnocchi_api_dimensions: "{{ default_container_dimensions }}"
gnocchi_metricd_dimensions: "{{ default_container_dimensions }}"
gnocchi_statsd_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack
####################

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -39,6 +40,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -63,6 +65,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -108,6 +108,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
register: check_gnocchi_containers
when:
- kolla_action != "config"

View File

@ -12,6 +12,7 @@ grafana_services:
- "/etc/localtime:/etc/localtime:ro"
- "grafana:/var/lib/grafana/"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ grafana_dimensions }}"
####################
# Database
@ -53,3 +54,5 @@ grafana_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_
grafana_tag: "{{ openstack_release }}"
grafana_image_full: "{{ grafana_image }}:{{ grafana_tag }}"
grafana_admin_username: "admin"
grafana_dimensions: "{{ default_container_dimensions }}"

View File

@ -13,6 +13,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -106,6 +106,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
register: check_grafana_containers
when:
- kolla_action != "config"

View File

@ -12,6 +12,7 @@ haproxy_services:
- "{{ node_config_directory }}/haproxy/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "haproxy_socket:/var/lib/kolla/haproxy/"
dimensions: "{{ haproxy_dimensions }}"
keepalived:
container_name: keepalived
group: haproxy
@ -23,6 +24,7 @@ haproxy_services:
- "/etc/localtime:/etc/localtime:ro"
- "/lib/modules:/lib/modules:ro"
- "haproxy_socket:/var/lib/kolla/haproxy/"
dimensions: "{{ keepalived_dimensions }}"
####################
@ -61,3 +63,6 @@ haproxy_listen_http_extra: []
haproxy_max_connections: 4000
haproxy_processes: 1
haproxy_process_cpu_map: "no"
haproxy_dimensions: "{{ default_container_dimensions }}"
keepalived_dimensions: "{{ default_container_dimensions }}"

View File

@ -13,6 +13,7 @@
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -38,6 +39,7 @@
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -101,6 +101,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
privileged: "{{ item.value.privileged | default(False) }}"
register: check_haproxy_containers
when:

View File

@ -12,6 +12,7 @@ heat_services:
- "/etc/localtime:/etc/localtime:ro"
- "{{ kolla_dev_repos_directory ~ '/heat/heat:/var/lib/kolla/venv/lib/python2.7/site-packages/heat' if heat_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ heat_api_dimensions }}"
heat-api-cfn:
container_name: heat_api_cfn
group: heat-api-cfn
@ -22,6 +23,7 @@ heat_services:
- "/etc/localtime:/etc/localtime:ro"
- "{{ kolla_dev_repos_directory ~ '/heat/heat:/var/lib/kolla/venv/lib/python2.7/site-packages/heat' if heat_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ heat_api_cfn_dimensions }}"
heat-engine:
container_name: heat_engine
group: heat-engine
@ -32,6 +34,7 @@ heat_services:
- "/etc/localtime:/etc/localtime:ro"
- "{{ kolla_dev_repos_directory ~ '/heat/heat:/var/lib/kolla/venv/lib/python2.7/site-packages/heat' if heat_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ heat_engine_dimensions }}"
####################
# Database
@ -59,6 +62,10 @@ heat_engine_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ doc
heat_engine_tag: "{{ heat_tag }}"
heat_engine_image_full: "{{ heat_engine_image }}:{{ heat_engine_tag }}"
heat_api_dimensions: "{{ default_container_dimensions }}"
heat_api_cfn_dimensions: "{{ default_container_dimensions }}"
heat_engine_dimensions: "{{ default_container_dimensions }}"
####################
# OpenStack

View File

@ -14,6 +14,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -38,6 +39,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -62,6 +64,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -102,6 +102,7 @@
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_heat_containers
when:
- kolla_action != "config"

View File

@ -202,6 +202,7 @@
ipc_mode: "{{ item.value.ipc_mode|default(omit) }}"
privileged: "{{ item.value.privileged|default(False) }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}"
register: check_nova_containers
when:
- kolla_action != "config"

View File

@ -8,12 +8,7 @@ Overview
~~~~~~~~
Since the Rocky release it is possible to restrict
the resource usage of deployed containers.
The following components support this feature:
* Nova
In Kolla Ansible,
the resource usage of deployed containers. In Kolla Ansible,
container resources to be constrained are referred to as dimensions.
The `Docker documentation <https://docs.docker.com/config/containers/resource_constraints/>`__
@ -39,7 +34,42 @@ Pre-deployment Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dimensions are defined as a mapping from a Docker resource name
(e.g. ``cpu_period``) to a string constraint value.
.. list-table:: Resource Constraints
:widths: 25 25 25
:header-rows: 1
* - Resource
- Data Type
- Default Value
* - cpu_period
- Integer
- 0
* - blkio_weight
- Integer
- 0
* - cpu_quota
- Integer
- 0
* - cpu_shares
- Integer
- 0
* - mem_limit
- Integer
- 0
* - memswap_limit
- Integer
- 0
* - mem_reservation
- Integer
- 0
* - cpuset_cpus
- String
- ''(Empty String)
* - cpuset_mems
- String
- ''(Empty String)
The variable ``default_container_dimensions`` sets the default dimensions
for all supported containers, and by default these are unconstrained.

View File

@ -810,6 +810,82 @@ class TestAttrComp(base.BaseTestCase):
self.dw = get_DockerWorker({'state': 'running'})
self.assertFalse(self.dw.compare_container_state(container_info))
def test_compare_dimensions_pos(self):
self.fake_data['params']['dimensions'] = {
'blkio_weight': 10, 'mem_limit': 30}
container_info = dict()
container_info['HostConfig'] = {
'CpuPeriod': 0, 'KernelMemory': 0, 'Memory': 0, 'CpuQuota': 0,
'CpusetCpus': '', 'CpuShares': 0, 'BlkioWeight': 0,
'CpusetMems': '', 'MemorySwap': 0, 'MemoryReservation': 0}
self.dw = get_DockerWorker(self.fake_data['params'])
self.assertTrue(self.dw.compare_dimensions(container_info))
def test_compare_dimensions_neg(self):
self.fake_data['params']['dimensions'] = {
'blkio_weight': 10}
container_info = dict()
container_info['HostConfig'] = {
'CpuPeriod': 0, 'KernelMemory': 0, 'Memory': 0, 'CpuQuota': 0,
'CpusetCpus': '', 'CpuShares': 0, 'BlkioWeight': 10,
'CpusetMems': '', 'MemorySwap': 0, 'MemoryReservation': 0}
self.dw = get_DockerWorker(self.fake_data['params'])
self.assertFalse(self.dw.compare_dimensions(container_info))
def test_compare_wrong_dimensions(self):
self.fake_data['params']['dimensions'] = {
'blki_weight': 0}
container_info = dict()
container_info['HostConfig'] = {
'CpuPeriod': 0, 'KernelMemory': 0, 'Memory': 0, 'CpuQuota': 0,
'CpusetCpus': '', 'CpuShares': 0, 'BlkioWeight': 0,
'CpusetMems': '', 'MemorySwap': 0, 'MemoryReservation': 0}
self.dw = get_DockerWorker(self.fake_data['params'])
self.dw.compare_dimensions(container_info)
self.dw.module.exit_json.assert_called_once_with(
failed=True, msg=repr("Unsupported dimensions"),
unsupported_dimensions=set(['blki_weight']))
def test_compare_empty_dimensions(self):
self.fake_data['params']['dimensions'] = dict()
container_info = dict()
container_info['HostConfig'] = {
'CpuPeriod': 0, 'KernelMemory': 0, 'Memory': 0, 'CpuQuota': 0,
'CpusetCpus': '1', 'CpuShares': 0, 'BlkioWeight': 0,
'CpusetMems': '', 'MemorySwap': 0, 'MemoryReservation': 0}
self.dw = get_DockerWorker(self.fake_data['params'])
self.assertTrue(self.dw.compare_dimensions(container_info))
def test_compare_dimensions_removed_and_changed(self):
self.fake_data['params']['dimensions'] = {
'mem_reservation': 10}
container_info = dict()
# Here mem_limit and mem_reservation are already present
# Now we are updating only 'mem_reservation'.
# Ideally it should return True stating that the docker
# dimensions have been changed.
container_info['HostConfig'] = {
'CpuPeriod': 0, 'KernelMemory': 0, 'Memory': 10, 'CpuQuota': 0,
'CpusetCpus': '', 'CpuShares': 0, 'BlkioWeight': 0,
'CpusetMems': '', 'MemorySwap': 0, 'MemoryReservation': 10}
self.dw = get_DockerWorker(self.fake_data['params'])
self.assertTrue(self.dw.compare_dimensions(container_info))
def test_compare_dimensions_explicit_default(self):
self.fake_data['params']['dimensions'] = {
'mem_reservation': 0}
container_info = dict()
# Here mem_limit and mem_reservation are already present
# Now we are updating only 'mem_reservation'.
# Ideally it should return True stating that the docker
# dimensions have been changed.
container_info['HostConfig'] = {
'CpuPeriod': 0, 'KernelMemory': 0, 'Memory': 0, 'CpuQuota': 0,
'CpusetCpus': '', 'CpuShares': 0, 'BlkioWeight': 0,
'CpusetMems': '', 'MemorySwap': 0, 'MemoryReservation': 0}
self.dw = get_DockerWorker(self.fake_data['params'])
self.assertFalse(self.dw.compare_dimensions(container_info))
def test_compare_container_state_pos(self):
container_info = {'State': dict(Status='running')}
self.dw = get_DockerWorker({'state': 'exited'})