Deprecate sparse LVs

That feature was never tested in Nova and we had some bugs. Deprecating it.

Change-Id: I6f05bb32313de1d832fe080c00a74508224acd77
This commit is contained in:
Sylvain Bauza 2018-03-05 15:16:32 +01:00
parent a6edacd66c
commit 0b11a09327
4 changed files with 20 additions and 2 deletions

View File

@ -665,6 +665,13 @@ Related options:
"""),
cfg.BoolOpt('sparse_logical_volumes',
default=False,
deprecated_for_removal=True,
deprecated_since='18.0.0',
deprecated_reason="""
Sparse logical volumes is a feature that is not tested hence not supported.
LVM logical volumes are preallocated by default. If you want thin provisioning,
use Cinder thin-provisioned volumes.
""",
help="""
Create sparse logical volumes (with virtualsize) if this flag is set to True.
"""),

View File

@ -685,8 +685,8 @@ class Lvm(Image):
super(Lvm, self).__init__(path, "block", "raw", is_block_dev=True)
# TODO(pbrady): possibly deprecate libvirt.sparse_logical_volumes
# for the more general preallocate_images
# TODO(sbauza): Remove the config option usage and default the
# LVM logical volume creation to preallocate the full size only.
self.sparse = CONF.libvirt.sparse_logical_volumes
self.preallocate = not self.sparse

View File

@ -35,6 +35,7 @@ CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)
# TODO(sbauza): Remove the possibility to ask for a sparse LV.
def create_volume(vg, lv, size, sparse=False):
"""Create LVM image.

View File

@ -0,0 +1,10 @@
---
deprecations:
- |
The ``[libvirt]/sparse_logical_volumes`` configuration option is now
deprecated. Sparse logical volumes were never verified by tests in Nova
and some bugs were found without having fixes so we prefer to deprecate
that feature.
By default, the LVM image backend allocates all the disk size to a logical
volume. If you want to have the volume group having thin-provisioned
logical volumes, use Cinder with volume-backed instances.