# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
+#ceph_mds_docker_memory_limit: 1g
+#ceph_mds_docker_cpu_limit: 1
+
#ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }}
#ceph_config_keys: [] # DON'T TOUCH ME
# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_mgr_docker_extra_env' variable.
+#ceph_mgr_docker_memory_limit: 1g
+#ceph_mgr_docker_cpu_limit: 1
+
#ceph_mgr_docker_extra_env: -e CLUSTER={{ cluster }} -e MGR_NAME={{ ansible_hostname }}
#ceph_config_keys: [] # DON'T TOUCH ME
# The value for 'key' can be a pre-generated key,
# e.g key: "AQDC2UxZH4yeLhAAgTaZb+4wDUlYOsr1OfZSpQ=="
# By default, keys will be auto-generated.
-#
+#
# To have have ansible setfacl the generated key, set the acls var like so:
# acls: ["u:nova:r--", "u:cinder:r--", "u:glance:r--", "u:gnocchi:r--"]
#openstack_keys:
##########
#ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the monitor_interface
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_mon_docker_extra_env' variable.
+#ceph_mon_docker_memory_limit: 1g
+#ceph_mon_docker_cpu_limit: 1
+
# ceph_mon_docker_extra_env:
#
# Use this variable to add extra env configuration to run your mon container.
#ceph_config_keys: [] # DON'T TOUCH ME
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_osd_docker_extra_env' variable.
+#ceph_osd_docker_memory_limit: 1g
+#ceph_osd_docker_cpu_limit: 1
+
# PREPARE DEVICE
#
# WARNING /!\ DMCRYPT scenario ONLY works with Docker version 1.12.5 and above
# NOTE: deprecated generic local user id for pre-Luminous releases
#ceph_rbd_mirror_local_user: "admin"
+
#################
# CONFIGURATION #
#################
# /etc/ceph/<remote_cluster>.client.<remote_user>.keyring
#ceph_rbd_mirror_remote_user: ""
+
##########
# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_rbd_mirror_docker_extra_env' variable.
+#ceph_rbd_mirror_docker_memory_limit: 1g
+#ceph_rbd_mirror_docker_cpu_limit: 1
+
+#ceph_rbd_mirror_docker_extra_env:
#ceph_config_keys: [] # DON'T TOUCH ME
# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_rgw_docker_extra_env' variable.
+#ceph_rgw_docker_memory_limit: 1g
+#ceph_rgw_docker_cpu_limit: 1
+
#ceph_rgw_docker_extra_env:
#ceph_config_keys: [] # DON'T TOUCH ME
#rgw_config_keys: "/" # DON'T TOUCH ME
monitor_name: "{{ ansible_fqdn }}"
when: mon_use_fqdn
+- name: get docker version
+ command: docker --version
+ changed_when: false
+ always_run: yes
+ register: docker_version
+
+- set_fact:
+ docker_version: "{{ docker_version.stdout.split(' ')[2] }}"
+
- name: check if a cluster is already running
command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'"
register: ceph_health
# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_mds_docker_extra_env' variable.
+ceph_mds_docker_memory_limit: 1g
+ceph_mds_docker_cpu_limit: 1
+
ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }}
ceph_config_keys: [] # DON'T TOUCH ME
ExecStartPre=-/usr/bin/docker stop ceph-mds-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/docker rm ceph-mds-{{ ansible_hostname }}
ExecStart=/usr/bin/docker run --rm --net=host \
- {% if not containerized_deployment_with_kv -%}
- -v /var/lib/ceph:/var/lib/ceph \
- -v /etc/ceph:/etc/ceph \
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}} \
- -e KV_PORT={{kv_port}} \
- {% endif -%}
- -v /etc/localtime:/etc/localtime:ro \
- -e CEPH_DAEMON=MDS \
- -e CEPHFS_CREATE=1 \
- {{ ceph_mds_docker_extra_env }} \
- --name=ceph-mds-{{ ansible_hostname }} \
- {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
+ --memory={{ ceph_mds_docker_memory_limit }} \
+ {% if docker_version.split('.')[0] | version_compare('13', '>=') -%}
+ --cpus={{ ceph_mds_docker_cpu_limit }} \
+ {% else -%}
+ --cpu-quota={{ ceph_mds_docker_cpu_limit * 100000 }} \
+ {% endif -%}
+ {% if not containerized_deployment_with_kv -%}
+ -v /var/lib/ceph:/var/lib/ceph \
+ -v /etc/ceph:/etc/ceph \
+ {% else -%}
+ -e KV_TYPE={{kv_type}} \
+ -e KV_IP={{kv_endpoint}} \
+ -e KV_PORT={{kv_port}} \
+ {% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
+ -e CEPH_DAEMON=MDS \
+ -e CEPHFS_CREATE=1 \
+ {{ ceph_mds_docker_extra_env }} \
+ --name=ceph-mds-{{ ansible_hostname }} \
+ {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop ceph-mds-{{ ansible_hostname }}
Restart=always
RestartSec=10s
# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_mgr_docker_extra_env' variable.
+ceph_mgr_docker_memory_limit: 1g
+ceph_mgr_docker_cpu_limit: 1
+
ceph_mgr_docker_extra_env: -e CLUSTER={{ cluster }} -e MGR_NAME={{ ansible_hostname }}
ceph_config_keys: [] # DON'T TOUCH ME
ExecStartPre=-/usr/bin/docker stop ceph-mgr-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/docker rm ceph-mgr-{{ ansible_hostname }}
ExecStart=/usr/bin/docker run --rm --net=host \
- {% if not containerized_deployment_with_kv -%}
- -v /var/lib/ceph:/var/lib/ceph \
- -v /etc/ceph:/etc/ceph \
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}} \
- -e KV_PORT={{kv_port}} \
- {% endif -%}
- -v /etc/localtime:/etc/localtime:ro \
- -e CEPH_DAEMON=MGR \
- {{ ceph_mgr_docker_extra_env }} \
- --name=ceph-mgr-{{ ansible_hostname }} \
- {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
+ --memory={{ ceph_mgr_docker_memory_limit }} \
+ {% if docker_version.split('.')[0] | version_compare('13', '>=') -%}
+ --cpus={{ ceph_mgr_docker_cpu_limit }} \
+ {% else -%}
+ --cpu-quota={{ ceph_mgr_docker_cpu_limit * 100000 }} \
+ {% endif -%}
+ {% if not containerized_deployment_with_kv -%}
+ -v /var/lib/ceph:/var/lib/ceph \
+ -v /etc/ceph:/etc/ceph \
+ {% else -%}
+ -e KV_TYPE={{kv_type}} \
+ -e KV_IP={{kv_endpoint}} \
+ -e KV_PORT={{kv_port}} \
+ {% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
+ -e CEPH_DAEMON=MGR \
+ {{ ceph_mgr_docker_extra_env }} \
+ --name=ceph-mgr-{{ ansible_hostname }} \
+ {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop ceph-mgr-{{ ansible_hostname }}
Restart=always
RestartSec=10s
# The value for 'key' can be a pre-generated key,
# e.g key: "AQDC2UxZH4yeLhAAgTaZb+4wDUlYOsr1OfZSpQ=="
# By default, keys will be auto-generated.
-#
+#
# To have have ansible setfacl the generated key, set the acls var like so:
# acls: ["u:nova:r--", "u:cinder:r--", "u:glance:r--", "u:gnocchi:r--"]
openstack_keys:
##########
ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the monitor_interface
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_mon_docker_extra_env' variable.
+ceph_mon_docker_memory_limit: 1g
+ceph_mon_docker_cpu_limit: 1
+
# ceph_mon_docker_extra_env:
#
# Use this variable to add extra env configuration to run your mon container.
ExecStartPre=-/usr/bin/docker rm ceph-mon-%i
ExecStartPre=$(command -v mkdir) -p /etc/ceph /var/lib/ceph/mon
ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i --net=host \
- {% if not containerized_deployment_with_kv -%}
- -v /var/lib/ceph:/var/lib/ceph \
- -v /etc/ceph:/etc/ceph \
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}}\
- -e KV_PORT={{kv_port}} \
- {% endif -%}
- -v /etc/localtime:/etc/localtime:ro \
- {% if mon_docker_privileged -%}
- --privileged \
- {% endif -%}
- {% if mon_docker_net_host -%}
- --net=host \
- {% endif -%}
- -e CEPH_DAEMON=MON \
- -e CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }} \
- -e IP_VERSION={{ ip_version[-1:] }} \
- {% if monitor_address is defined and monitor_address != '0.0.0.0' %}
- {% if ip_version == 'ipv4' -%}
- -e MON_IP={{ monitor_address }} \
- {% elif ip_version == 'ipv6' -%}
- -e MON_IP=[{{ monitor_address }}] \
- {% endif -%}
- {% elif ip_version == 'ipv4' -%}
- -e MON_IP={{ hostvars[inventory_hostname]['ansible_' + monitor_interface][ip_version]['address'] }} \
- {% elif ip_version =='ipv6' -%}
- -e MON_IP=[{{ hostvars[inventory_hostname]['ansible_' + monitor_interface][ip_version][0]['address'] }}] \
- {% endif -%}
- {{ ceph_mon_docker_extra_env }} \
- {{ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
+ --memory={{ ceph_mon_docker_memory_limit }} \
+ {% if docker_version.split('.')[0] | version_compare('13', '>=') -%}
+ --cpus={{ ceph_mon_docker_cpu_limit }} \
+ {% else -%}
+ --cpu-quota={{ ceph_mon_docker_cpu_limit * 100000 }} \
+ {% endif -%}
+ {% if not containerized_deployment_with_kv -%}
+ -v /var/lib/ceph:/var/lib/ceph \
+ -v /etc/ceph:/etc/ceph \
+ {% else -%}
+ -e KV_TYPE={{kv_type}} \
+ -e KV_IP={{kv_endpoint}}\
+ -e KV_PORT={{kv_port}} \
+ {% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
+ {% if mon_docker_privileged -%}
+ --privileged \
+ {% endif -%}
+ {% if mon_docker_net_host -%}
+ --net=host \
+ {% endif -%}
+ -e CEPH_DAEMON=MON \
+ -e CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }} \
+ -e IP_VERSION={{ ip_version[-1:] }} \
+ {% if monitor_address is defined and monitor_address != '0.0.0.0' %}
+ {% if ip_version == 'ipv4' -%}
+ -e MON_IP={{ monitor_address }} \
+ {% elif ip_version == 'ipv6' -%}
+ -e MON_IP=[{{ monitor_address }}] \
+ {% endif -%}
+ {% elif ip_version == 'ipv4' -%}
+ -e MON_IP={{ hostvars[inventory_hostname]['ansible_' + monitor_interface][ip_version]['address'] }} \
+ {% elif ip_version =='ipv6' -%}
+ -e MON_IP=[{{ hostvars[inventory_hostname]['ansible_' + monitor_interface][ip_version][0]['address'] }}] \
+ {% endif -%}
+ {{ ceph_mon_docker_extra_env }} \
+ {{ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop ceph-mon-%i
Restart=always
RestartSec=10s
ceph_config_keys: [] # DON'T TOUCH ME
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_osd_docker_extra_env' variable.
+ceph_osd_docker_memory_limit: 1g
+ceph_osd_docker_cpu_limit: 1
+
# PREPARE DEVICE
#
# WARNING /!\ DMCRYPT scenario ONLY works with Docker version 1.12.5 and above
--net=host \
--privileged=true \
--pid=host \
+ --memory={{ ceph_osd_docker_memory_limit }} \
+ {% if docker_version.split('.')[0] | version_compare('13', '>=') -%}
+ --cpus={{ ceph_osd_docker_cpu_limit }} \
+ {% else -%}
+ --cpu-quota={{ ceph_osd_docker_cpu_limit * 100000 }} \
+ {% endif -%}
-v /dev:/dev \
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/ceph:/var/lib/ceph \
# NOTE: deprecated generic local user id for pre-Luminous releases
ceph_rbd_mirror_local_user: "admin"
+
#################
# CONFIGURATION #
#################
# /etc/ceph/<remote_cluster>.client.<remote_user>.keyring
ceph_rbd_mirror_remote_user: ""
+
##########
# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_rbd_mirror_docker_extra_env' variable.
+ceph_rbd_mirror_docker_memory_limit: 1g
+ceph_rbd_mirror_docker_cpu_limit: 1
+
+ceph_rbd_mirror_docker_extra_env:
ceph_config_keys: [] # DON'T TOUCH ME
ExecStartPre=-/usr/bin/docker stop ceph-rbd-mirror-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/docker rm ceph-rbd-mirror-{{ ansible_hostname }}
ExecStart=/usr/bin/docker run --rm --net=host \
- {% if not containerized_deployment_with_kv -%}
- -v /etc/ceph:/etc/ceph \
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}} \
- -e KV_PORT={{kv_port}} \
- {% endif -%}
- -v /etc/localtime:/etc/localtime:ro \
- -e CEPH_DAEMON=RBD_MIRROR \
- --name=ceph-rbd-mirror-{{ ansible_hostname }} \
- {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
+ --memory={{ ceph_rbd_mirorr_docker_memory_limit }} \
+ {% if docker_version.split('.')[0] | version_compare('13', '>=') -%}
+ --cpus={{ ceph_rbd_mirror_docker_cpu_limit }} \
+ {% else -%}
+ --cpu-quota={{ ceph_rbd_mirorr_docker_cpu_limit * 100000 }} \
+ {% endif -%}
+ {% if not containerized_deployment_with_kv -%}
+ -v /etc/ceph:/etc/ceph \
+ {% else -%}
+ -e KV_TYPE={{kv_type}} \
+ -e KV_IP={{kv_endpoint}} \
+ -e KV_PORT={{kv_port}} \
+ {% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
+ -e CEPH_DAEMON=RBD_MIRROR \
+ --name=ceph-rbd-mirror-{{ ansible_hostname }} \
+ {{ ceph_rbd_mirror_docker_extra_env }} \
+ {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop ceph-rbd-mirror-{{ ansible_hostname }}
Restart=always
RestartSec=10s
# DOCKER #
##########
+# Resource limitation
+# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
+# Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations
+# These options can be passed using the 'ceph_rgw_docker_extra_env' variable.
+ceph_rgw_docker_memory_limit: 1g
+ceph_rgw_docker_cpu_limit: 1
+
ceph_rgw_docker_extra_env:
ceph_config_keys: [] # DON'T TOUCH ME
rgw_config_keys: "/" # DON'T TOUCH ME
ExecStartPre=-/usr/bin/docker stop ceph-rgw-{{ ansible_hostname }}
ExecStartPre=-/usr/bin/docker rm ceph-rgw-{{ ansible_hostname }}
ExecStart=/usr/bin/docker run --rm --net=host \
+ --memory={{ ceph_rgw_docker_memory_limit }} \
+ {% if docker_version.split('.')[0] | version_compare('13', '>=') -%}
+ --cpus={{ ceph_rgw_docker_cpu_limit }} \
+ {% else -%}
+ --cpu-quota={{ ceph_rgw_docker_cpu_limit * 100000 }} \
+ {% endif -%}
{% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph \
-v /etc/ceph:/etc/ceph \