Bug 1575411 - image_cache_download causes wrong uploaded image into engine
Summary: image_cache_download causes wrong uploaded image into engine
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-ansible-collection
Classification: oVirt
Component: image-template
Version: 1.1.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.4
: ---
Assignee: Ondra Machacek
QA Contact: Petr Kubica
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-06 16:52 UTC by Petr Kubica
Modified: 2018-06-26 08:36 UTC (History)
2 users (show)

Fixed In Version: ovirt-ansible-image-template-1.1.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-26 08:36:41 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-ansible-image-template pull 13 0 None None None 2018-05-16 11:30:23 UTC

Description Petr Kubica 2018-05-06 16:52:15 UTC
Description of problem:
In second run of this role, due to this parameter which is set to True by default, when user wants to upload another image, role takes previous uploaded image from /tmp to upload into engine.

Version-Release number of selected component (if applicable):
oVirt.image-template (1.1.6)
ansible-2.5.2-1.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. upload an image (without set image_cache_download) 
2. upload different image (without set image_cache_download)  

Actual results:
created template will be from first image and not from second

Additional info:
- parameter should be set to False
- no caching images at all - who wants to upload the same template twice?
- comparing specified image (url) and downloaded image by size and other attributes (if match - if it is the same image)

Comment 1 Ondra Machacek 2018-05-06 17:52:14 UTC
As per whats written in the documentation this is expected behavior:

 https://github.com/ovirt/ovirt-ansible-image-template

So what's actual issue?

> - parameter should be set to False

Why? I am not against it, if we have strong arguments.

> - no caching images at all - who wants to upload the same template twice?

more setups for example

> - comparing specified image (url) and downloaded image by size and other attributes (if match - if it is the same image)

Size isn't reliable parameter for comparison. We should support hash as we do in miq role.

Comment 2 Petr Kubica 2018-05-08 14:38:29 UTC
(In reply to Ondra Machacek from comment #1)
> As per whats written in the documentation this is expected behavior:
> 
>  https://github.com/ovirt/ovirt-ansible-image-template
> 
> So what's actual issue?
> 

yes, but it's expected that cached image is the image which I want to upload to engine. For example:
- If I upload an image within 10 days [1]. I will expect that uploaded image will be the image specified by qcow_url and not some random image in /tmp from previous run. 
- When I upload more images to engine. Cached is true by default but from user perspective it doesn't mean that if file with name 'ovirt_image_data' exists upload that file. I expect: Cache downloaded image for next time (Probably I will use the image again) And in next run: If image specified by url is already cached, don't download the "same" image again and use cached.

> > - parameter should be set to False
> 
> Why? I am not against it, if we have strong arguments.
> 
Based on above, but it can be True - but only with caching more images than one
- when I will want to upload two different images into multiple setups
> > - no caching images at all - who wants to upload the same template twice?
> 
> more setups for example
> 
> > - comparing specified image (url) and downloaded image by size and other attributes (if match - if it is the same image)
> 
> Size isn't reliable parameter for comparison. We should support hash as we
> do in miq role.
I think it can't be hash, it isn't about checking the image (if image was downloaded correctly) - to compute hash you must download the image first and with caching you want to avoid downloading the image again. I know, on some servers you can find hash of files but it's really small group of servers.
so how user could find hash of these files:
http://releases.manageiq.org/
http://cloud.centos.org/centos/7/images/

ManageIQ hasn't hashes for all images:
https://github.com/ManageIQ/manageiq.org/issues/526

[1] 10 days is defined in /usr/lib/tmpfiles.d/tmp.conf as default for cleaning files in /tmp (10 days only if nobody didn't touch the file)

Comment 3 Petr Kubica 2018-06-25 13:52:02 UTC
Verified in
ovirt-ansible-image-template-1.1.7-1.el7ev.noarch
ansible-2.6.0-0.3.rc3.el7ae.noarch

Comment 4 Sandro Bonazzola 2018-06-26 08:36:41 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 release, it has been closed with a resolution of CURRENT RELEASE.

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


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