-
Notifications
You must be signed in to change notification settings - Fork 269
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
Specify image size #522
Specify image size #522
Conversation
ci test please |
7cb7922
to
64da5a0
Compare
ci test please |
1 similar comment
ci test please |
/hold |
cf5af2a
to
588116b
Compare
ci test please |
588116b
to
035349e
Compare
LGTM other than updating the comment to reflect the current direction on this... will merge after that's updated and CI passes. |
/hold cancel |
592c26e
to
809135e
Compare
809135e
to
6c6331a
Compare
Signed-off-by: Alexander Wels <[email protected]>
cad870d
to
10a2fc0
Compare
Combined code from PR#489 and PR#490 by @gites and @danielerez Added some tests and rebased on current master. Signed-off-by: Alexander Wels <[email protected]>
10a2fc0
to
260d4fa
Compare
// ResizeImage resizes the images to match the requested size. Sometimes provisioners misbehave and the available space | ||
// is not the same as the requested space. For those situations we compare the available space to the requested space and | ||
// use the smallest of the two values. | ||
func ResizeImage(dest, imageSize string) error { |
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.
@awels Is this being called somewhere?
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.
Whoops, you are right it is not, but obviously it should, making a patch to fix now.
@awels where do we do the filesystem overhead calculation and subtract from requested size? |
@zvikorn ResizeImage does the calculation. The algorithm is: take whatever is passed from the controller (The request size) and then compare to the available space on the file system of the PVC that is mounted in the container. Pick the lesser of the two. |
@awels As I need to use this algo as well, should we remove this from datastream over to util and make it common? |
I debated doing that, I wasn't sure if you could use the same algorithm or
not, if you can, feel free.
…On Wed, Nov 21, 2018 at 9:25 AM zvikorn ***@***.***> wrote:
@awels <https://github.com/awels> As I need to use this algo as well,
should we remove this from datastream over to util and make it common?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#522 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEUF7mEA9DYprPEoERTsY0u-xEC2Q6yPks5uxWI9gaJpZM4YeaWK>
.
|
Yea..... I guess I only need to take the minimum between
'util.GetAvailableSpace(dest)'
and t he requested size, so that's fine. Thanks!
On Wed, Nov 21, 2018 at 4:28 PM Alexander Wels <[email protected]>
wrote:
… I debated doing that, I wasn't sure if you could use the same algorithm or
not, if you can, feel free.
On Wed, Nov 21, 2018 at 9:25 AM zvikorn ***@***.***> wrote:
> @awels <https://github.com/awels> As I need to use this algo as well,
> should we remove this from datastream over to util and make it common?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#522 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AEUF7mEA9DYprPEoERTsY0u-xEC2Q6yPks5uxWI9gaJpZM4YeaWK
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#522 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcepjNKYqXAuz-ypI2TLyZYG-C3hia0uks5uxWLsgaJpZM4YeaWK>
.
|
@awels so.... I cannot use the GetAvailableSpace as the PVC is not bound yet at that point. I will subtract 4% for FS from the requested image size, unless we have something else to think about... |
Not sure what you mean, in the importer the PVC is by definition bound, and that is where you have to do the calculation of which one to pick. |
yea, I take my words back. I believe the PVC is bound at that point. |
So we don't have to take the FS overhead into account anymore, since its mounted with a FS on it, the available reported by the FS is what is available. We are just taking the minimum of that that value and the requested image size. |
Also just verified that I am getting the requested information from GetAvailableSpace, however found a bug that its not actually calling resize image at the right time, will have a PR to fix that soon. |
Ok. Thanks. I tried getAvailableSpace in qemu.go in the createBlankImage method just right before I’m calling the qemu-img and it return ‘0’. I will try it again and also will try it in the importer.
…Sent from my iPhone
On 23 Nov 2018, at 18:00, Alexander Wels ***@***.***> wrote:
Also just verified that I am getting the requested information from GetAvailableSpace, however found a bug that its not actually calling resize image at the right time, will have a PR to fix that soon.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is this fixed ? |
So this particular issue is talking about the virtual disk size. We do NOT resize the partition inside the VM because we don't know which (if there are multiple) partition you would like to have resized. So if you run something like fdisk inside the VM, it will show the disk is the size you requested, however the partitions will not be. |
Hi, thanks for the fast answer. I ve read your comment #1150 (comment) so i did but:
It seems its not resizing the virtual disk size..
|
Oh i missed you were cloning, so there is a known issue #930 about resizing after cloning. In particular since we can clone any persistent volume, we cannot be sure we cloned a virtual disk. That is why we are not resizing after a clone. It is a definite issue we need to solve at some point. |
Combined code from #489 and #490 by
@gites and
@danielerez
Added some tests and rebased on current master.
What this PR does / why we need it:
This PR calculates the needed image size based on the PVC request size (Not the actual PVC size), and resizes the image to match.
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 #482
Special notes for your reviewer:
This should finally get the feature in CDI.
Release note:
Co-authored-by: Tomasz Pawelczak [email protected]
Co-authored-by: Daniel Erez [email protected]