Bug 1956964

Summary: upload a boot-source to OpenShift virtualization using the console
Product: OpenShift Container Platform Reporter: Kobig <kgershon>
Component: Console Kubevirt PluginAssignee: Gilad Lekner <glekner>
Status: CLOSED ERRATA QA Contact: Guohua Ouyang <gouyang>
Severity: low Docs Contact:
Priority: high    
Version: 4.6CC: aos-bugs, glekner, gouyang, spadgett, tnisan, yzamir
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:03:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kobig 2021-05-04 18:46:34 UTC
Description of problem:
When trying to upload boot-source file from the GUI the process hangs OR 
failes on not enough space in the PVC.

When doing the same form Virtctl - the process is working well 


Version-Release number of selected component (if applicable):4.6 

Steps to Reproduce:
Do all the steps from the gui
1.Create PVC of 15-20GB
2.follow this guide to upload boot-source: https://docs.openshift.com/container-platform/4.6/virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.html
3.

Actual results:
Cant upload boot-source image from gui

Expected results:
Managing to upload boot-source image from gui

Additional info:
Error messages should be more "nice" to the user to read and understand not drilling into logs, error on the screen is the direct approach so the user will understand what is the issue and wont need to open a case for help in understanding the log

Comment 2 Yaacov Zamir 2021-06-02 07:20:28 UTC
setting priority to high because this issue comes up by many users

Comment 3 Guohua Ouyang 2021-06-02 07:39:29 UTC
It related to storage issue: https://bugzilla.redhat.com/show_bug.cgi?id=1963027

Comment 4 Yaacov Zamir 2021-06-03 05:21:34 UTC
set blocker to (-) because in regular flow users should set the target disk size to be bigger than the size of uploaded file.

set priority to high because the UI should have better handling of cases where users try to uploaded files bigger then the target filesystems.

Comment 5 Yaacov Zamir 2021-06-09 06:58:17 UTC
Gilad hi,

can you comment here about the progress, with checking the file size ?
we also need to make sure that the error message a user see when the PVC size is too small is nicer than it is now

Kobig hi,

> When doing the same form Virtctl - the process is working well 

are you sure ?
can I upload a big image into a smaller PVC using the CLI ?
does it expand the PVC to match the size ?

Comment 7 Yaacov Zamir 2021-06-09 08:37:16 UTC
> Please correct me if i wrong but the size of the PVC should be twice the size of the actual image disk right? this means if the image is 5G then the image is 10G, then way:
> 1. can we set the size automatically? when the user upload the file we just set the size X*2 and if he clicks next then it will work out of the box
> 2. why not adding this info to the wizard so the user will know what he needs to do and what size to give? I mean a regular Person will just give it what it needs or max, X*1.2 just to play safe, but no one will give x*2 of the size.

Gilad hi,

Can you implement Konbig suggestions in https://github.com/openshift/console/pull/9179 of some followup ?

Comment 8 Gilad Lekner 2021-06-09 10:21:52 UTC
yes, will implement x2 PVC size error message,
will also implement automatic size filling on choosing a file

Comment 9 Guohua Ouyang 2021-06-09 11:14:53 UTC
There are two problems mentioned in this bug:
1. the error message is not nice
2. auto-fill the PVC size

For problem #1, let's take a look at the virtctl outputs, maybe we can give the same error message on UI like the virtctl did.

$ virtctl image-upload dv cirros2 --size=40Mi --image-path=./cirros.img --storage-class=ocs-storagecluster-ceph-rbd --access-mode=ReadWriteMany --block-volume --insecure
DataVolume gh/cirros2 created
Waiting for PVC cirros2 upload pod to be ready...
Pod now ready
Uploading data to https://cdi-uploadproxy-openshift-cnv.apps.akalenyu48.cnv-qe.rhcloud.com

 12.13 MiB / 12.13 MiB [==================================================================================================] 100.00% 14s

unexpected return value 400, Saving stream failed: Virtual image size 46137344 is larger than available size 41943040 (PVC size 46137344, reserved overhead 0.000000%). A larger PVC is required.



For problem #2, The image size is about 13M, but it requires PVC size is about 50M, not X*2, so I'm not sure how we can achieve the purpose by X*2.

$ virtctl image-upload dv cirros1 --size=50Mi --image-path=./cirros.img --storage-class=ocs-storagecluster-ceph-rbd --access-mode=ReadWriteMany --block-volume --insecure
DataVolume gh/cirros1 created
Waiting for PVC cirros1 upload pod to be ready...
Pod now ready
Uploading data to https://cdi-uploadproxy-openshift-cnv.apps.akalenyu48.cnv-qe.rhcloud.com

 12.13 MiB / 12.13 MiB [==================================================================================================] 100.00% 15s

Uploading data completed successfully, waiting for processing to complete, you can hit ctrl-c without interrupting the progress
Processing completed successfully
Uploading ./cirros.img completed successfully


And I tested that uploading a image via UI has no difference from virtctl image-upload.
On UI, uploading is failed if the pvc size is 40Mi, it succeeds if the PVC size is 50Mi.

Comment 11 Gilad Lekner 2021-06-14 09:05:36 UTC
(In reply to Guohua Ouyang from comment #9)
> There are two problems mentioned in this bug:
> 1. the error message is not nice
> 2. auto-fill the PVC size
> 
> For problem #1, let's take a look at the virtctl outputs, maybe we can give
> the same error message on UI like the virtctl did.
> 
> $ virtctl image-upload dv cirros2 --size=40Mi --image-path=./cirros.img
> --storage-class=ocs-storagecluster-ceph-rbd --access-mode=ReadWriteMany
> --block-volume --insecure
> DataVolume gh/cirros2 created
> Waiting for PVC cirros2 upload pod to be ready...
> Pod now ready
> Uploading data to
> https://cdi-uploadproxy-openshift-cnv.apps.akalenyu48.cnv-qe.rhcloud.com
> 
>  12.13 MiB / 12.13 MiB
> [============================================================================
> ======================] 100.00% 14s
> 
> unexpected return value 400, Saving stream failed: Virtual image size
> 46137344 is larger than available size 41943040 (PVC size 46137344, reserved
> overhead 0.000000%). A larger PVC is required.
> 
> 
> 
> For problem #2, The image size is about 13M, but it requires PVC size is
> about 50M, not X*2, so I'm not sure how we can achieve the purpose by X*2.
> 
> $ virtctl image-upload dv cirros1 --size=50Mi --image-path=./cirros.img
> --storage-class=ocs-storagecluster-ceph-rbd --access-mode=ReadWriteMany
> --block-volume --insecure
> DataVolume gh/cirros1 created
> Waiting for PVC cirros1 upload pod to be ready...
> Pod now ready
> Uploading data to
> https://cdi-uploadproxy-openshift-cnv.apps.akalenyu48.cnv-qe.rhcloud.com
> 
>  12.13 MiB / 12.13 MiB
> [============================================================================
> ======================] 100.00% 15s
> 
> Uploading data completed successfully, waiting for processing to complete,
> you can hit ctrl-c without interrupting the progress
> Processing completed successfully
> Uploading ./cirros.img completed successfully
> 
> 
> And I tested that uploading a image via UI has no difference from virtctl
> image-upload.
> On UI, uploading is failed if the pvc size is 40Mi, it succeeds if the PVC
> size is 50Mi.

The prefilled minimum size is 1Gi.
if the image size is above 0.5Gi, it will be x2 the image.

Comment 13 Yaacov Zamir 2021-08-10 05:38:54 UTC
https://github.com/openshift/console/pull/9179 merged upstream, move to modified

Comment 14 Yaacov Zamir 2021-08-10 05:41:10 UTC
Note to verifier:
a - user can not upload a file into a PVC that is smaller then the unzipped file.
b - the UI should alert users that the PVC may be smaller then needed to avoid such cases

Comment 16 Guohua Ouyang 2021-08-11 10:56:30 UTC
The solution is still not good, now it has warning message "PVC size is smaller than double the provided image. Please ensure your PVC size covers the requirements of the uncompressed image and any other space requirements", as the tests above shows double size is not working.

I tested that filling a size which is larger than the double size of the image, the warning disappeard, but upload is still failed with 400 error.

Is there a way to show the similar error "unexpected return value 400, Saving stream failed: Virtual image size 46137344 is larger than available size 41943040 (PVC size 46137344, reserved overhead 0.000000%). A larger PVC is required." on UI? how hard will it be? I think it's best solution instead of estimating the possible size by ui.

I would assign the bug back because of upload is failed even it has no warning about the size.

Comment 20 Guohua Ouyang 2021-11-03 03:48:18 UTC
verified on 4.10.0-0.nightly-2021-11-01-163833

Comment 24 errata-xmlrpc 2022-03-10 16:03:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056