Skip to content

Commit

Permalink
volume: allow extend cow preallocated
Browse files Browse the repository at this point in the history
Relax assumption that cow volumes do now need
to be extended to only those that are sparse.
Preallocated volumes should be extended to avoid
pausing VMs when it reaches its truesize, while
having bigger capacity.

Bug-Url: https://bugzilla.redhat.com/2170689
Signed-off-by: Albert Esteve <aesteve@redhat.com>
  • Loading branch information
aesteve-rh committed Feb 20, 2023
1 parent af00ec8 commit 603699c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/vdsm/storage/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,11 +1381,11 @@ def extendSize(self, new_capacity):
raise se.VolumeNonWritable(self.volUUID)

volFormat = self.getFormat()
if volFormat == sc.COW_FORMAT:
if volFormat == sc.COW_FORMAT and self.getType() == sc.SPARSE_VOL:
self.log.debug("skipping cow size extension for volume %s to "
"capacity %s", self.volUUID, new_capacity)
return
elif volFormat != sc.RAW_FORMAT:
if volFormat not in [sc.RAW_FORMAT, sc.COW_FORMAT]:
raise se.IncorrectFormat(self.volUUID)

# Note: This function previously prohibited extending non-leaf volumes.
Expand Down
1 change: 0 additions & 1 deletion tests/storage/blocksd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,6 @@ def test_reduce_volume_skipped(domain_factory, fake_task, fake_sanlock):

@requires_root
@pytest.mark.root
@pytest.mark.xfail(reason='Cow volumes are not extended.')
def test_extend_volume(domain_factory, fake_task, fake_sanlock):
"""
Test added to verify fix for https://bugzilla.redhat.com/2170689.
Expand Down

0 comments on commit 603699c

Please sign in to comment.