Skip to content

Conversation

@gaohoward
Copy link
Collaborator

@gaohoward gaohoward commented Sep 10, 2025

When cloning from a source, the host cloner should check the requested size for the target tmp pvc if the tmp source pvc is of block volume mode and the target pvc is of filesystem volume mode because it should take filesystem overhead into consideration and enlarge the original request size accordingly
before creating the tmp pvc.

Because currently the check is missing the cloning will fail on validation.

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Fix: Host assisted clone should adjust requested storage when cloning from block to filesystem volume mode

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 10, 2025
@kubevirt-bot
Copy link
Contributor

Hi @gaohoward. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign aglitke for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 10, 2025
@akalenyu
Copy link
Collaborator

/test all

@coveralls
Copy link

coveralls commented Sep 11, 2025

Coverage Status

coverage: 59.079% (+0.003%) from 59.076%
when pulling 761f2df on gaohoward:cnv-44140
into 4c3dc65 on kubevirt:main.

@gaohoward gaohoward force-pushed the cnv-44140 branch 2 times, most recently from 4942c4d to 3869e6a Compare September 15, 2025 02:53
@gaohoward gaohoward force-pushed the cnv-44140 branch 2 times, most recently from af4abed to 6a01cfa Compare October 13, 2025 09:13
@awels
Copy link
Member

awels commented Oct 13, 2025

I am probably missing something, but didn't #3384 fix this particular issue? Or did I miss a particular case with that PR?

@gaohoward
Copy link
Collaborator Author

I am probably missing something, but didn't #3384 fix this particular issue? Or did I miss a particular case with that PR?

Yeah I think it goes a different path. In this case it falls back to host-clone from smart-clone (supported by provisioner), and in that case it didn't take the fs overhead into account.

@awels
Copy link
Member

awels commented Oct 13, 2025

Gotcha, okay, let me know if you need a review on the PR.

@gaohoward
Copy link
Collaborator Author

Gotcha, okay, let me know if you need a review on the PR.

Yes pleas review. Thanks @awels !

return nil, err
}

realSourcePvcSizeRequest := sourcePvc.Spec.Resources.Requests[corev1.ResourceStorage]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only thing I have some concern about, this works fine if the source volume mode is block, since we can just inflate the size of the source PVC to account for the overhead. But if the source volume mode is filesystem, it is likely the source is already inflated, and we don't want to inflate it again. I think in that case we should check if there is a datavolume associated with the PVC, and get the size from there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @awel. I think I see the point. I'll try correct it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awels I've made some changes to improve it. Pls take a look. Thanks!

@gaohoward gaohoward force-pushed the cnv-44140 branch 2 times, most recently from d00ad6c to 95f11c4 Compare October 23, 2025 08:53
@gaohoward
Copy link
Collaborator Author

/retest

2 similar comments
@gaohoward
Copy link
Collaborator Author

/retest

@gaohoward
Copy link
Collaborator Author

/retest

when cloning from block to filesystem volume mode (kubevirt#3900)

When cloning from a source, the host cloner should
check the requested size for the target tmp pvc if
the tmp source pvc is of block volume mode and the
target pvc is of filesystem volume mode because it
should take filesystem overhead into consideration
and enlarge the original request size accordingly
before creating the tmp pvc.

Because currently the check is missing the cloning
will fail on validation.

Signed-off-by: Howard Gao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants