diff --git a/group_vars/default/pvc.yml b/group_vars/default/pvc.yml index 1eb4138..d74a19a 100644 --- a/group_vars/default/pvc.yml +++ b/group_vars/default/pvc.yml @@ -72,6 +72,12 @@ pvc_asn: "65500" pvc_routers: - "192.168.100.1" +# Ceph OSD tuning +# > Uncomment in low-memory situation (nodes with <32GB RAM). +# > These options are *only* applied at cluster bootstrap and cannot be changed later. +# OSD memory limit - 939524096 (~900MB) is the lowest possible value; default is 4GB. +#pvc_osd_memory_limit: 939524096 + # Node list # > Every node configured with this playbook must be specified in this list. pvc_nodes: diff --git a/roles/pvc/tasks/ceph/bootstrap.yml b/roles/pvc/tasks/ceph/bootstrap.yml index c3f053b..a226625 100644 --- a/roles/pvc/tasks/ceph/bootstrap.yml +++ b/roles/pvc/tasks/ceph/bootstrap.yml @@ -68,9 +68,19 @@ - "osd journal size = 2" - "osd pool default size = 3" - "osd pool default min size = 2" - - "osd pool default pg num = 512" - - "osd pool default pgp num = 512" + - "osd pool default pg num = 256" + - "osd pool default pgp num = 256" - "osd crush chooseleaf type = 1" + - "bluestore cache autotune = true" + +- name: add memory limit if requested + lineinfile: + dest: /tmp/ceph-bootstrap/ceph.conf + line: "{{ item }}" + state: present + with_items: + - "osd memory target = {{ pvc_osd_memory_limit }}" + when: pvc_osd_memory_limit is defined - name: collect bootstrapped Ceph files into the role fetch: