mirror of https://github.com/ceph/ceph-ansible.git
config: convert _osd_memory_target to int
ceph.conf doesn't accept float value.
Typical error seen:
```
$ sudo ceph daemon osd.2 config get osd_memory_target
Can't get admin socket path: unable to get conf option admin_socket for osd.2:
parse error setting 'osd_memory_target' to '7823740108,8' (strict_si_cast:
unit prefix not recognized)
```
This commit ensures the value inserted in ceph.conf will be an integer.
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 68dde424f6
)
pull/3365/head
parent
abdc245ceb
commit
1a1886a442
|
@ -156,11 +156,11 @@ filestore xattr use omap = true
|
|||
[osd]
|
||||
{% if is_hci and _num_osds > 0 %}
|
||||
{% if ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds > osd_memory_target %} # hci_safety_factor is the safety factor for HCI deployments
|
||||
{% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds) %}
|
||||
{% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds) | int %}
|
||||
{% endif %}
|
||||
{% elif _num_osds > 0 %}
|
||||
{% if ansible_memtotal_mb * 1048576 * non_hci_safety_factor / _num_osds > osd_memory_target %} # non_hci_safety_factor is the safety factor for dedicated nodes
|
||||
{% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * non_hci_safety_factor / _num_osds) %}
|
||||
{% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * non_hci_safety_factor / _num_osds) | int %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
osd memory target = {{ _osd_memory_target | default(osd_memory_target) }}
|
||||
|
|
Loading…
Reference in New Issue