]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Revert "config: Always use osd_memory_target if set"
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 9 Dec 2020 19:02:45 +0000 (14:02 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Sat, 12 Dec 2020 05:56:32 +0000 (06:56 +0100)
This reverts commit 4d1fdd2b05d55f8028fb5593d41fa61dbddd7095.

This breaks the backward compatibility with previous osd_memory_target
calculation and we could have a value lower than the minimum value allowed
(896M) which causes some ceph commands to fail (like ceph assimilate-conf).

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-config/templates/ceph.conf.j2
roles/ceph-defaults/defaults/main.yml

index 92729eb2d3eeed8ea470c12856a13ceac11c1fbc..a0a29111aa2c5fa2c715b24ca23c26ead9bbde70 100644 (file)
@@ -342,12 +342,10 @@ dummy:
 
 ## OSD options
 #
-# Variables to calculate a suitable osd_memory_target based on the number of OSDs
 #is_hci: false
 #hci_safety_factor: 0.2
 #non_hci_safety_factor: 0.7
-# You can also set an explicit value which will override the calculation if set.
-# osd_memory_target: 4294967296
+#osd_memory_target: 4294967296
 #journal_size: 5120 # OSD journal size in MB
 #block_db_size: -1 # block db size in bytes for the ceph-volume lvm batch. -1 means use the default of 'as big as possible'.
 #public_network: 0.0.0.0/0
index 18911d357e4ec75062b398aed21b74b8ef54e7c9..6d82d1e449d60d994e9b0de2a0d3f954307726e6 100644 (file)
@@ -342,12 +342,10 @@ ceph_iscsi_config_dev: false
 
 ## OSD options
 #
-# Variables to calculate a suitable osd_memory_target based on the number of OSDs
 #is_hci: false
 #hci_safety_factor: 0.2
 #non_hci_safety_factor: 0.7
-# You can also set an explicit value which will override the calculation if set.
-# osd_memory_target: 4294967296
+#osd_memory_target: 4294967296
 #journal_size: 5120 # OSD journal size in MB
 #block_db_size: -1 # block db size in bytes for the ceph-volume lvm batch. -1 means use the default of 'as big as possible'.
 #public_network: 0.0.0.0/0
index 5f094cb6faf7bd3663b749c2579390d6044637e6..1fdb764311f9165f48189361c982c644a7fad62e 100644 (file)
@@ -82,16 +82,18 @@ filestore xattr use omap = true
 {% if osd_objectstore == 'bluestore' %}
 {% set _num_osds = num_osds | default(0) | int %}
 [osd]
-{% if is_hci | bool and _num_osds > 0 and not osd_memory_target is defined %}
+{% if is_hci | bool and _num_osds > 0 %}
 {# hci_safety_factor is the safety factor for HCI deployments #}
+{% if ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds > osd_memory_target %}
 {% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds) | int %}
-{% elif _num_osds > 0 and not osd_memory_target is defined %}
+{% endif %}
+{% elif _num_osds > 0 %}
 {# non_hci_safety_factor is the safety factor for dedicated nodes #}
+{% if ansible_memtotal_mb * 1048576 * non_hci_safety_factor / _num_osds > osd_memory_target %}
 {% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * non_hci_safety_factor / _num_osds) | int %}
 {% endif %}
-{% if _osd_memory_target is defined or osd_memory_target is defined %}
-osd memory target = {{ _osd_memory_target | default(osd_memory_target) }}
 {% endif %}
+osd memory target = {{ _osd_memory_target | default(osd_memory_target) }}
 {% endif %}
 {% endif %}
 
index 30fa626d73d406699f2488d83a75f590e7e18f2c..9015776d8e86e18f7c3ae4509e13877373f9f990 100644 (file)
@@ -334,12 +334,10 @@ cephfs_pools:
 
 ## OSD options
 #
-# Variables to calculate a suitable osd_memory_target based on the number of OSDs
 is_hci: false
 hci_safety_factor: 0.2
 non_hci_safety_factor: 0.7
-# You can also set an explicit value which will override the calculation if set.
-# osd_memory_target: 4294967296
+osd_memory_target: 4294967296
 journal_size: 5120 # OSD journal size in MB
 block_db_size: -1 # block db size in bytes for the ceph-volume lvm batch. -1 means use the default of 'as big as possible'.
 public_network: 0.0.0.0/0