- Only applicable if action is 'batch'.
required: false
default: -1
+ block_db_devices:
+ description:
+ - A list of devices for bluestore block db to pass to the 'ceph-volume lvm batch' subcommand.
+ - Only applicable if action is 'batch'.
+ - Only applicable if objectstore is 'bluestore'.
+ required: false
+ wal_devices:
+ description:
+ - A list of devices for bluestore block wal to pass to the 'ceph-volume lvm batch' subcommand.
+ - Only applicable if action is 'batch'.
+ - Only applicable if objectstore is 'bluestore'.
+ required: false
report:
description:
- If provided the --report flag will be passed to 'ceph-volume lvm batch'.
cmd.extend(batch_devices)
if block_db_devices and objectstore == 'bluestore':
- cmd.extend(['--db-devices', ' '.join(block_db_devices)])
+ cmd.append('--db-devices')
+ cmd.extend(block_db_devices)
if wal_devices and objectstore == 'bluestore':
- cmd.extend(['--wal-devices', ' '.join(wal_devices)])
+ cmd.append('--wal-devices')
+ cmd.extend(wal_devices)
return cmd
result = ceph_volume.batch(
fake_module, fake_container_image)
assert result == expected_command_list
+
+ def test_batch_bluestore_with_dedicated_db(self):
+ fake_module = MagicMock()
+ fake_module.params = {'objectstore': 'bluestore',
+ 'block_db_size': '-1',
+ 'cluster': 'ceph',
+ 'batch_devices': ["/dev/sda", "/dev/sdb"],
+ 'block_db_devices': ["/dev/sdc", "/dev/sdd"]}
+
+ fake_container_image = None
+ expected_command_list = ['ceph-volume',
+ '--cluster',
+ 'ceph',
+ 'lvm',
+ 'batch',
+ '--bluestore',
+ '--yes',
+ '/dev/sda',
+ '/dev/sdb',
+ '--db-devices',
+ '/dev/sdc',
+ '/dev/sdd']
+ result = ceph_volume.batch(
+ fake_module, fake_container_image)
+ assert result == expected_command_list
+
+ def test_batch_bluestore_with_dedicated_wal(self):
+ fake_module = MagicMock()
+ fake_module.params = {'objectstore': 'bluestore',
+ 'cluster': 'ceph',
+ 'block_db_size': '-1',
+ 'batch_devices': ["/dev/sda", "/dev/sdb"],
+ 'wal_devices': ["/dev/sdc", "/dev/sdd"]}
+
+ fake_container_image = None
+ expected_command_list = ['ceph-volume',
+ '--cluster',
+ 'ceph',
+ 'lvm',
+ 'batch',
+ '--bluestore',
+ '--yes',
+ '/dev/sda',
+ '/dev/sdb',
+ '--wal-devices',
+ '/dev/sdc',
+ '/dev/sdd']
+ result = ceph_volume.batch(
+ fake_module, fake_container_image)
+ assert result == expected_command_list
+
+ def test_batch_bluestore_with_custom_db_size(self):
+ fake_module = MagicMock()
+ fake_module.params = {'objectstore': 'bluestore',
+ 'cluster': 'ceph',
+ 'block_db_size': '4096',
+ 'batch_devices': ["/dev/sda", "/dev/sdb"]}
+
+ fake_container_image = None
+ expected_command_list = ['ceph-volume',
+ '--cluster',
+ 'ceph',
+ 'lvm',
+ 'batch',
+ '--bluestore',
+ '--yes',
+ '--block-db-size',
+ '4096',
+ '/dev/sda',
+ '/dev/sdb']
+ result = ceph_volume.batch(
+ fake_module, fake_container_image)
+ assert result == expected_command_list