Add Ceph support for single-node clusters

Ensures that the pool default size/min size is set to something
reasonable for a single node (effective RAID-1) and replace teh default
CRUSH replicate_rule set for this situation with one choosing OSD
instead of host as the default.
This commit is contained in:
Joshua Boniface 2023-09-01 15:42:28 -04:00
parent 7d29665805
commit 6cf8948107
2 changed files with 19 additions and 0 deletions

View File

@ -80,6 +80,16 @@
- "bluestore cache autotune = true" - "bluestore cache autotune = true"
- "rbd default features = 5" - "rbd default features = 5"
- name: add single-node cluster options
lineinfile:
dest: /tmp/ceph-bootstrap/ceph.conf
line: "{{ item }}"
state: present
with_items:
- "osd pool default size = 2"
- "osd pool default min size = 1"
when: "{{ pvc_nodes | length }} == 1"
- name: add memory limit if requested - name: add memory limit if requested
lineinfile: lineinfile:
dest: /tmp/ceph-bootstrap/ceph.conf dest: /tmp/ceph-bootstrap/ceph.conf

View File

@ -129,6 +129,15 @@
- ceph-mon@{{ ansible_hostname }} - ceph-mon@{{ ansible_hostname }}
- ceph-mgr@{{ ansible_hostname }} - ceph-mgr@{{ ansible_hostname }}
# Single-node cluster ruleset
- name: remove default CRUSH replicated_rule ruleset
command: ceph osd crush rule rm replicated_rule
when: "{{ pvc_nodes | length }} == 1"
- name: add single-node CRUSH replicated_rule ruleset
command: ceph osd crush rule create-replicated replicated_rule default osd
when: "{{ pvc_nodes | length }} == 1"
# System OSD CPU shielding activation # System OSD CPU shielding activation
- block: - block:
- name: install packages - name: install packages