osd: add block_db_devices option support to ceph_volume module

This commit adds the `block_db_devices` option support to the
ceph_volume module.
passing a devices list in `dedicated_devices` will make ceph-volume
creating 1 vg using these devices to create block.db partitions for data
devices.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/4450/head
Guillaume Abrioux 2019-08-20 15:57:45 +02:00
parent c785ad3637
commit 7b836eaa47
4 changed files with 20 additions and 0 deletions

View File

@ -41,6 +41,13 @@ dummy:
#devices: []
# Declare devices to be used as block.db devices
#dedicated_devices:
# - /dev/sda
# - /dev/sdb
#dedicated_devices: []
#'osd_auto_discovery' mode prevents you from filling out the 'devices' variable above.
# Device discovery is based on the Ansible fact 'ansible_devices'

View File

@ -279,6 +279,7 @@ def batch(module, container_image):
crush_device_class = module.params.get('crush_device_class', None)
journal_size = module.params.get('journal_size', None)
block_db_size = module.params.get('block_db_size', None)
block_db_devices = module.params.get('block_db_devices', None)
dmcrypt = module.params.get('dmcrypt', None)
osds_per_device = module.params.get('osds_per_device', 1)
@ -317,6 +318,9 @@ def batch(module, container_image):
cmd.extend(batch_devices)
if block_db_devices:
cmd.extend(['--db-devices', ' '.join(block_db_devices)])
return cmd
@ -503,6 +507,7 @@ def run_module():
osds_per_device=dict(type='int', required=False, default=1),
journal_size=dict(type='str', required=False, default='5120'),
block_db_size=dict(type='str', required=False, default='-1'),
block_db_devices=dict(type='list', required=False, default=[]),
report=dict(type='bool', required=False, default=False),
containerized=dict(type='str', required=False, default=False),
osd_fsid=dict(type='str', required=False),

View File

@ -33,6 +33,13 @@ copy_admin_key: false
devices: []
# Declare devices to be used as block.db devices
#dedicated_devices:
# - /dev/sda
# - /dev/sdb
dedicated_devices: []
#'osd_auto_discovery' mode prevents you from filling out the 'devices' variable above.
# Device discovery is based on the Ansible fact 'ansible_devices'

View File

@ -10,6 +10,7 @@
osds_per_device: "{{ osds_per_device }}"
journal_size: "{{ journal_size }}"
block_db_size: "{{ block_db_size }}"
block_db_devices: "{{ dedicated_devices | unique if dedicated_devices | length > 0 else omit }}"
action: "batch"
environment:
CEPH_VOLUME_DEBUG: 1