Bug 1539104 - Every try to upload a qcow2 disk via Upload button ends immediatelly with 'not a valid image' error
Summary: Every try to upload a qcow2 disk via Upload button ends immediatelly with 'no...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Frontend.WebAdmin
Version: 4.2.1.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.2.2
: ---
Assignee: Daniel Erez
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-26 16:29 UTC by Jiri Belka
Modified: 2018-01-31 09:44 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-31 09:44:28 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)
screenshot of Upload Image dialog (57.80 KB, image/png)
2018-01-30 11:08 UTC, Jiri Belka
no flags Details

Description Jiri Belka 2018-01-26 16:29:49 UTC
Description of problem:

Every try to upload a disk via Upload button ends immediatelly with 'not a valid image' error.

According to https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.2-beta/html/administration_guide/sect-virtual_disk_tasks raw and qcow2 are supported.

Why nothing is logged into engine.log?
Why format are supported exactly?
- qcow2 has multiple compat versions (i cannot reproduce but i saw an error
  about invalid compat version - 1.1)

Version-Release number of selected component (if applicable):
ovirt-engine-webadmin-portal-4.2.1.3-0.1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. qemu-img create -f qcow2 test.qcow2 10G
2. try to upload this disk via Upload
3.

Actual results:
quite useless error in the dialog, nothing in engine.log, docs is very vague

Expected results:
info about why is not my disk accepted, info in engine.log

Additional info:

Comment 1 Yaniv Kaul 2018-01-28 08:09:31 UTC
Logs?

Comment 2 Daniel Erez 2018-01-28 08:59:12 UTC
The upload image must be a aligned (i.e. multiple of 512 bytes),
as vdsm's supported block size is 512. Documentation should be
updated, I'll open a bug for it if missing.. Can you please check
that upload of aligned qcow images are works as expected.

Comment 3 Jiri Belka 2018-01-29 09:09:51 UTC
(In reply to Yaniv Kaul from comment #1)
> Logs?

because there is nothing logged, it seems to be in UI.

Comment 4 Jiri Belka 2018-01-29 09:11:43 UTC
(In reply to Daniel Erez from comment #2)
> The upload image must be a aligned (i.e. multiple of 512 bytes),
> as vdsm's supported block size is 512. Documentation should be
> updated, I'll open a bug for it if missing.. Can you please check
> that upload of aligned qcow images are works as expected.

it's in description... the issue still persists.

$ qemu-img create -f qcow2 test.qcow2 10G
Formatting 'test.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536 lazy_refcounts=off refcount_bits=16

$ qemu-img info test.qcow2 
image: test.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

$ echo "10737418240/512" | bc -l

Comment 5 Daniel Erez 2018-01-29 10:14:05 UTC
(In reply to Jiri Belka from comment #4)
> (In reply to Daniel Erez from comment #2)
> > The upload image must be a aligned (i.e. multiple of 512 bytes),
> > as vdsm's supported block size is 512. Documentation should be
> > updated, I'll open a bug for it if missing.. Can you please check
> > that upload of aligned qcow images are works as expected.
> 
> it's in description... the issue still persists.
> 
> $ qemu-img create -f qcow2 test.qcow2 10G
> Formatting 'test.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536
> lazy_refcounts=off refcount_bits=16
> 
> $ qemu-img info test.qcow2 
> image: test.qcow2
> file format: qcow2
> virtual size: 10G (10737418240 bytes)
> disk size: 196K
> cluster_size: 65536
> Format specific information:
>     compat: 1.1
>     lazy refcounts: false
>     refcount bits: 16
>     corrupt: false
> 
> $ echo "10737418240/512" | bc -l

We actually check alignment by the actual size not the virtual one, which should also be aligned in this example. The issue here could be the qemu compat version, 1.1 is supported only for V4 storage format type, otherwise it should be 0.10. Can you please try uploading to V4 domain. Also, can you attach a screenshot of the error.

Comment 6 Daniel Erez 2018-01-29 11:08:24 UTC
Opened bug 1539630 to update documentation.

Comment 7 Jiri Belka 2018-01-30 11:07:24 UTC
(In reply to Daniel Erez from comment #5)
> (In reply to Jiri Belka from comment #4)
> > (In reply to Daniel Erez from comment #2)
> > > The upload image must be a aligned (i.e. multiple of 512 bytes),
> > > as vdsm's supported block size is 512. Documentation should be
> > > updated, I'll open a bug for it if missing.. Can you please check
> > > that upload of aligned qcow images are works as expected.
> > 
> > it's in description... the issue still persists.
> > 
> > $ qemu-img create -f qcow2 test.qcow2 10G
> > Formatting 'test.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536
> > lazy_refcounts=off refcount_bits=16
> > 
> > $ qemu-img info test.qcow2 
> > image: test.qcow2
> > file format: qcow2
> > virtual size: 10G (10737418240 bytes)
> > disk size: 196K
> > cluster_size: 65536
> > Format specific information:
> >     compat: 1.1
> >     lazy refcounts: false
> >     refcount bits: 16
> >     corrupt: false
> > 
> > $ echo "10737418240/512" | bc -l
> 
> We actually check alignment by the actual size not the virtual one, which
> should also be aligned in this example. The issue here could be the qemu
> compat version, 1.1 is supported only for V4 storage format type, otherwise
> it should be 0.10. Can you please try uploading to V4 domain. Also, can you
> attach a screenshot of the error.

Aligning the virtual size? So you are restricting users to prepare their own images via qemu-img create? See example:

> for i in 1 2 5 10 15 30 ; do qemu-img create -f qcow2 -o compat=0.10 test.qcow2 ${i}G >/dev/null 2>&1; size=$( stat -c "%s" test.qcow2); echo -n "virtual size: $size; divided by 512: "; echo $size/512 | bc -l ; rm -f test.qcow2 ; done                                                              
virtual size: 196624; divided by 512: 384.03125000000000000000
virtual size: 196640; divided by 512: 384.06250000000000000000
virtual size: 196688; divided by 512: 384.15625000000000000000
virtual size: 196768; divided by 512: 384.31250000000000000000
virtual size: 196848; divided by 512: 384.46875000000000000000
virtual size: 197088; divided by 512: 384.93750000000000000000

Or do I have to use any other options?

> qemu-img create -f qcow2 -o ? | grep size
size             Virtual disk size
cluster_size     qcow2 cluster size

Comment 8 Jiri Belka 2018-01-30 11:08:00 UTC
Created attachment 1388298 [details]
screenshot of Upload Image dialog

> qemu-img info test.qcow2
image: test.qcow2
file format: qcow2
virtual size: 10G (10737418240 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 0.10
    refcount bits: 16

Comment 9 Daniel Erez 2018-01-30 14:24:18 UTC
Right, so it seems that only *empty* qcow images are not aligned after all. I.e. the first write adds padding which makes it a multiple of 512. So, I'll revert the validation of alignment for now. 10x for catching it!

Comment 10 Daniel Erez 2018-01-30 16:47:58 UTC
Actually, we should leave the validation in the UI, as we don't allow uploading empty images. So, uploading an empty qcow images doesn't make sense.

@Jiri - please try uploading a non-empty qcow image, e.g. by creating one using the engine and write some data.

Comment 11 Allon Mureinik 2018-01-31 07:07:03 UTC
> The issue here could be the qemu
> compat version, 1.1 is supported only for V4 storage format type, otherwise
> it should be 0.10. Can you please try uploading to V4 domain.
If that's really the case, that's a bug.
V4 most definitely should support 0.10 images (e.g., once you upgrade to V4, all your previous 0.10 images remain unchanged).

Comment 12 Daniel Erez 2018-01-31 07:26:34 UTC
(In reply to Allon Mureinik from comment #11)
> > The issue here could be the qemu
> > compat version, 1.1 is supported only for V4 storage format type, otherwise
> > it should be 0.10. Can you please try uploading to V4 domain.
> If that's really the case, that's a bug.
> V4 most definitely should support 0.10 images (e.g., once you upgrade to V4,
> all your previous 0.10 images remain unchanged).

I've meant that you can't upload qcow 1.1 images to V3 domains. The other way around is indeed supported.

Comment 13 Daniel Erez 2018-01-31 09:44:28 UTC
To summarize limitations:
* Uploading qcow images with 1.1 compat level is support only for storage format >= V4.
* Uploading empty raw or qcow images is not supported.
* Image's actual size should be a multiple of 512.
* Uploading an image with a backing file is not supported using the UI (supported only using the API)

For example, I've successfully uploaded the following qcow2 image (1.1 compat level): http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img


Note You need to log in before you can comment on or make changes to this bug.