Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volume: allow extend cow preallocated #380

Merged

Conversation

aesteve-rh
Copy link
Member

Backport for #379

Currently we assume in the code that cow
volumes do not need to be extended in any case.
However, all preallocated volumes, both
cow and raw, should be extended when requested.
Otherwise, cow preallocated volumes have bigger
capacity than their truesize. Thus, when the size
of the disk reaches the truesize, the VM will
pause, which is an undesired effect.

To avoid this, we relax this assumption so that
only cow sparse volumes are skipped on extend calls.

Bug-Url: https://bugzilla.redhat.com/2170689
Signed-off-by: Albert Esteve aesteve@redhat.com

Add test to extend volume size. Preallocated volumes
(both raw and cow) should extend to prevent VMs from
pausing when reaching the volume truesize limit.

Test is used to reproduce the issue in
https://bugzilla.redhat.com/2170689

Signed-off-by: Albert Esteve <aesteve@redhat.com>
@nirs
Copy link
Member

nirs commented Feb 21, 2023

@aesteve-rh please fix the pr and commit message to describe only the
issue in the bug - preallocated volume are not preallocated during extend.

You can add a comment like:

(commit message was updated to to reflect the actual fix better) 

ahadas
ahadas previously approved these changes Feb 22, 2023
@ahadas
Copy link
Member

ahadas commented Feb 22, 2023

@aesteve-rh please fix the pr and commit message to describe only the issue in the bug - preallocated volume are not preallocated during extend.

You can add a comment like:

(commit message was updated to to reflect the actual fix better) 

+1
my approval was on the code changes

Currently we consider the format to
determine when to skip the extend calls,
so that cow volumes are always skipped.
However, the allocation policy is
more important. For preallocated volumes
it would make more sense to extend
the volumes so that they capacity
matches their truesize, and thus
it also matches user expectations.

NOTE: commit message was updated to reflect
the actual fix better

Bug-Url: https://bugzilla.redhat.com/2170689
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Rename '_extendSizeRaw' to just '_extendSize',
as COW preallocated volumes can also reach
this call to extend LVs.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add a test to ensure that extendSize is correctly
skipped for cow sparse volumes.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
Volume cannot be a different format than
cow or raw, therefore checking for it in
a condition is not necessary.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
Change extend skip condition (and msg),
so that it better reflects the intent.

We want to skip the extend call based on
the allocation type and not the format,
so that we skip sparse volumes

Signed-off-by: Albert Esteve <aesteve@redhat.com>
Current extend_volume_skipped test checks
only that the volume remains under the original
capacity. While this covers the usecase of
the volume not being extended to the new
capacity, it does not check that the volume
size has not changed.

We can make the check more precise with
little effort.

Fixes: a558d52
Signed-off-by: Albert Esteve <aesteve@redhat.com>
@aesteve-rh aesteve-rh merged commit 543d7f4 into oVirt:ovirt-4.5.3.z Feb 27, 2023
@aesteve-rh aesteve-rh deleted the aesteve/extend-row-preallocated branch February 27, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants