Use ``osd_scenario: lvm`` to enable this scenario. Currently we only support dedicated journals
when using lvm, not collocated journals.
-To configure this scenario use the ``lvm_volumes`` config option. ``lvm_volumes`` is a dictionary whose
-key/value pairs represent a data lv and a journal pair. Journals can be either a lv, device or partition.
-You can not use the same journal for many data lvs.
+To configure this scenario use the ``lvm_volumes`` config option. ``lvm_volumes`` is a list of dictionaries which can
+contain a ``data``, ``journal``, ``data_vg`` and ``journal_vg`` key. The ``data`` key represents the logical volume name that is to be used for your OSD
+data. The ``journal`` key represents the logical volume name, device or partition that will be used for your OSD journal. The ``data_vg``
+key represents the volume group name that your ``data`` logical volume resides on. This key is required for purging of OSDs created
+by this scenario. The ``journal_vg`` key is optional and should be the volume group name that your journal lv resides on, if applicable.
.. note::
Any logical volume or logical group used in ``lvm_volumes`` must be a name and not a path.
+.. note::
+ You can not use the same journal for many OSDs.
+
For example, a configuration to use the ``lvm`` osd scenario would look like::
osd_scenario: lvm
lvm_volumes:
- data-lv1: journal-lv1
- data-lv2: /dev/sda
- data:lv3: /dev/sdb1
+ - data: data-lv1
+ data_vg: vg1
+ journal: journal-lv1
+ journal_vg: vg2
+ - data: data-lv2
+ journal: /dev/sda
+ data_vg: vg1
+ - data: data-lv3
+ journal: /dev/sdb1
+ data_vg: vg2
# III. Use ceph-volume to create OSDs from logical volumes.
# Use 'osd_scenario: lvm' to enable this scenario. Currently we only support dedicated journals
# when using lvm, not collocated journals.
-# lvm_volumes is a dictionary whose key/value pair represent a data lv and a journal pair.
-# Any logical volume or logical group used must be a name and not a path.
-# Journals can be either a lv, device or partition. You can not use the same journal for many data lvs.
+# lvm_volumes is a list of dictionaries. Each dictionary must contain a data, journal and vg_name
+# key. Any logical volume or logical group used must be a name and not a path.
+# data must be a logical volume
+# journal can be either a lv, device or partition. You can not use the same journal for many data lvs.
+# data_vg must be the volume group name of the data lv
+# journal_vg is optional and must be the volume group name of the journal lv, if applicable
# For example:
# lvm_volumes:
-# data-lv1: journal-lv1
-# data-lv2: /dev/sda
-# data:lv3: /dev/sdb1
-lvm_volumes: {}
+# - data: data-lv1
+# data_vg: vg1
+# journal: journal-lv1
+# journal_vg: vg2
+# - data: data-lv2
+# journal: /dev/sda
+# data_vg: vg1
+# - data: data-lv3
+# journal: /dev/sdb1
+# data_vg: vg2
+lvm_volumes: []
##########
- not osd_auto_discovery
- lvm_volumes|length == 0
-- name: make sure the lvm_volumes variable is a dictionary
+- name: make sure the lvm_volumes variable is a list
fail:
- msg: "lvm_volumes: must be a dictionary"
+ msg: "lvm_volumes: must be a list"
when:
- osd_group_name is defined
- osd_group_name in group_names
- not osd_auto_discovery
- osd_scenario == "lvm"
- - lvm_volumes is not mapping
+ - lvm_volumes is string
- name: make sure the devices variable is a list
fail:
---
- name: use ceph-volume to create filestore osds with dedicated journals
- command: "ceph-volume lvm create --filestore --data {{ item.key }} --journal {{ item.value }}"
- with_dict: "{{ lvm_volumes }}"
+ command: "ceph-volume lvm create --filestore --data {{ item.data }} --journal {{ item.journal }}"
+ with_items: "{{ lvm_volumes }}"
copy_admin_key: true
# test-volume is created by tests/functional/lvm_setup.yml from /dev/sdb
lvm_volumes:
- test_volume: /dev/sdc
+ - data: test_volume
+ journal: /dev/sdc
+ data_vg: test_group
os_tuning_params:
- { name: kernel.pid_max, value: 4194303 }
- { name: fs.file-max, value: 26234859 }