Skip to content

Commit

Permalink
Set default lvm_type to auto
Browse files Browse the repository at this point in the history
We've had an lvm_type=thin for quite some time, and we've wanted to
make it Cinders default for a while, but there's no clean way to
migrate on upgrades.  So, we have a compromise, detect if the
deployment has volumes (including the thin pool).  If there are no
LVs or if the thin pool exists, use thin.  Otherwise, use the old
thick lvm-default.

This patch makes the default setting "auto" instead of "default"
(which is actually thick).

DocImpact: Need to update docs to reflect the default setting for
new deployments is auto (thin)

Change-Id: If25e814eb6282fef9a1dd30d17c80eab6860e275
  • Loading branch information
j-griffith committed Jun 16, 2017
1 parent 9769c6c commit 8c57c6d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cinder/tests/unit/volume/drivers/test_lvm_driver.py
Expand Up @@ -98,11 +98,13 @@ def test_delete_volume_thinlvm_snap(self, _mock_create_export,

@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,
Expand Down
2 changes: 1 addition & 1 deletion cinder/volume/drivers/lvm.py
Expand Up @@ -51,7 +51,7 @@
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.'),
Expand Down
@@ -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.

0 comments on commit 8c57c6d

Please sign in to comment.