-
Notifications
You must be signed in to change notification settings - Fork 305
Host assisted clone should adjust requested storage when cloning from block to filesystem volume mode (#3900) #3901
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @gaohoward. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test all |
4942c4d to
3869e6a
Compare
af4abed to
6a01cfa
Compare
|
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. |
|
Gotcha, okay, let me know if you need a review on the PR. |
Yes pleas review. Thanks @awels ! |
d00ad6c to
95f11c4
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
1 similar comment
|
/retest |
379d8bd to
c83e112
Compare
|
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for tackling this! I would appreciate a link to the bug so I can do some testing and see the origin of the issue.
I am a little confused that we have to inflate in the populator layer;
usually we do this in the mutating pvc webhook (on by default)/dv controllers
Here you are: Yes the issue happens at the very late stage where the snapshot clone falls back to host assisted clone. |
I see, though I am still confused by inflating this far into the process. Doesn't the target PVC get inflated anyhow by the webhook/DV controller (and thus so does the temp)? |
|
Also note that bug describes a separate issue that may still exist |
|
/cc @jpeimer |
|
@akalenyu: GitHub didn't allow me to request PR reviews from the following users: jpeimer. Note that only kubevirt members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
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. |
No the target PVC doesn't get inflated when doing snapshot clone. When the controller plans the clone it finds out the storage class is different from the volume snapshot's one and then it fall back to host assisted clone. When doing host clone phase it create the tmp target PVC, if we don't check here then it will report the failure because the target size is not enough (for this to happen the tmp target PVC volume mode must be filesystem). |
It doesn't happen for me on upstream. Can you share your yaml file? |
Yeah I don't see it either, may have to do with an older version
I was pretty sure we inflate filesystem target PVCs here -
|
This method is never called in this case. Actually the webhook rendering is not enabled. For snapshot cloning it basically fallback to host-assisted during the planning phase, and when the host-clone phase is handling the temp target pvc creation, it has a chance to make sure the target size is right (inflate if necessary). |
Webhook rendering is enabled since a few releases now, but anyway renderPvcSpecVolumeSize existed prior to it for the DV storage API. How come the target doesn't get inflated? |
|
I think the real issue here is that we don't inflate the PVC during mutation if it has a data source: containerized-data-importer/pkg/controller/datavolume/util.go Lines 65 to 88 in e1bfde0
containerized-data-importer/pkg/controller/datavolume/util.go Lines 246 to 255 in e1bfde0
We simply set the restore size if it's available and leave it as is otherwise. |
I rerun the test again and yes the webhook rendering is enabled. However the issue is that if the snapshot clone going as normal (doesn't fall back to host assisted) the target will get inflated as you said. But when it falls back to host clone, (clone strategy is copy), when the host-clone phase prepares the target tmp PVC, it didn't check the size
After this point the host clone takes over. If it doesn't fall back to host clone, the methods you mentioned get called and works. But if it go through host clone phase, we need this fix to take care of the size issue. |
Even if it does fall back to host clone the target PVC is created so it should be mutated according to the logic I wrote above, shouldn't we fix that logic instead? |
Not sure that's another issue or not but this doesn't help the host assisted clone. The host clone will create a temp target PVC based on its clone source (in this case a volume snapshot). The temp targetPVC must satisfy the size requirement (infalted if necessary) |
Yes webhook rendering is enabled. Please see my reply to @Acedus for explanation why it is happening |
This path is not exercised though if a size exists containerized-data-importer/pkg/controller/datavolume/util.go Lines 225 to 228 in e1bfde0
|
EDIT: The target tmp PVC doesn't have a dataSource so in theory it should just hit the standard path and inflate properly. |
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 <howard.gao@gmail.com>
|
@gaohoward: The following test failed, say
DetailsInstructions 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. I understand the commands that are listed here. |
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 #
https://issues.redhat.com/browse/CNV-44140
Special notes for your reviewer:
Release note: