diff --git a/cinder/tests/unit/volume/drivers/test_lvm_driver.py b/cinder/tests/unit/volume/drivers/test_lvm_driver.py index bbbf1beb824..a86d6e62b7f 100644 --- a/cinder/tests/unit/volume/drivers/test_lvm_driver.py +++ b/cinder/tests/unit/volume/drivers/test_lvm_driver.py @@ -98,11 +98,13 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase): @mock.patch.object(volutils, 'get_all_volume_groups', return_value=[{'name': 'cinder-volumes'}]) - def test_check_for_setup_error(self, vgs): + @mock.patch('cinder.brick.local_dev.lvm.LVM.get_lvm_version', + return_value=(2, 2, 100)) + def test_check_for_setup_error(self, _mock_get_version, vgs): vg_obj = fake_lvm.FakeBrickLVM('cinder-volumes', False, None, - 'default') + 'auto') configuration = conf.Configuration(fake_opt, 'fake_group') lvm_driver = lvm.LVMVolumeDriver(configuration=configuration, diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index d8d7e9ffaa6..4f88ec09afd 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -51,7 +51,7 @@ volume_opts = [ help='If >0, create LVs with multiple mirrors. Note that ' 'this requires lvm_mirrors + 2 PVs with available space'), cfg.StrOpt('lvm_type', - default='default', + default='auto', choices=['default', 'thin', 'auto'], help='Type of LVM volumes to deploy; (default, thin, or auto). ' 'Auto defaults to thin if thin is supported.'), diff --git a/releasenotes/notes/lvm-type-default-to-auto-a2ad554fc8bb25f2.yaml b/releasenotes/notes/lvm-type-default-to-auto-a2ad554fc8bb25f2.yaml new file mode 100644 index 00000000000..130b9db7173 --- /dev/null +++ b/releasenotes/notes/lvm-type-default-to-auto-a2ad554fc8bb25f2.yaml @@ -0,0 +1,7 @@ +--- +other: + - | + Modify default lvm_type setting from thick to auto. This will result in + Cinder preferring thin on init, if there are no LV's in the VG it will + create a thin-pool and use thin. If there are LV's and no thin-pool + it will continue using thick.