Bug 1755487

Summary: Wrong error returned when ovirt_template times out
Product: Red Hat Enterprise Virtualization Manager Reporter: Jan Zmeskal <jzmeskal>
Component: ansibleAssignee: Martin Necas <mnecas>
Status: CLOSED CURRENTRELEASE QA Contact: Pavol Brilla <pbrilla>
Severity: low Docs Contact:
Priority: low    
Version: 4.3.6CC: lleistne, lsvaty, mperina, mtessun, omachace
Target Milestone: ovirt-4.4.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhv-4.4.0-29 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-16 10:24:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Zmeskal 2019-09-25 15:23:19 UTC
Description of problem:
When creating a template out of Glance disk image, it might happen that (for example due to slow connection) the task times out. In that case, module returns this error:

TASK [Create teamplate out of Glance image] **************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Error: Fault reason is "Input validation failed.". Fault detail is "No matching signature found, make sure that mandatory attributes are provided.". HTTP response code is 400.
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Fault reason is \"Input validation failed.\". Fault detail is \"No matching signature found, make sure that mandatory attributes are provided.\". HTTP response code is 400."}

This error makes it seem as though I provided wrong parameters. However, the template was eventually created successfully - only it happened after the timeout.

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

How reproducible:
100 %

Steps to Reproduce:
1. Have a playbook like this:

- hosts: localhost
  gather_facts: false
  vars:
    engine_url: "https://fqdn/ovirt-engine/api"
    engine_username: "admin@internal"
    engine_password: "password"
  tasks:
    - name: Authenticate with oVirt
      ovirt_auth:
        url: "{{ engine_url }}"
        username: "{{ engine_username }}"
        password: "{{ engine_password }}"
        insecure: yes
    - name: Create template out of Glance image
      ovirt_template:
        auth: "{{ ovirt_auth }}"
        state: imported
        name: "my_template"
        image_disk: "disk"
        template_image_disk_name: "disk_from_glance"
        image_provider: "my_glance"
        storage_domain: "my_storage"
        cluster: "my_cluster"
        timeout: 60

2. Make sure that the timeout is low enought and that the time for copying of Glance image is greater than the timeout
3. Run the playbook.

Actual results:
Error about "Input validation failed" is printed.

Expected results:
The module should inform the user about the fact that the timeout was exceeded.

Comment 1 Martin Necas 2019-10-14 12:15:36 UTC
I added exception which tells that the image was not able to import and that user should try rerun it with a larger timeout.

Comment 4 Lukas Svaty 2020-04-16 10:24:26 UTC
Closing low/medium severity bugs, if you would like to still verify this issue please reopen.