Bug 1937408
| Summary: | [RFE] Add ability to import template from OVA in image_template role | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | amashah |
| Component: | ovirt-ansible-collection | Assignee: | Martin Necas <mnecas> |
| Status: | CLOSED ERRATA | QA Contact: | Barbora Dolezalova <bdolezal> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 4.4.4 | CC: | ahadas, apinnick, dfodor, emarcus, mavital, michal.skrivanek, mnecas, mperina, mtessun, oliel |
| Target Milestone: | ovirt-4.5.1 | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | ovirt-ansible-collection-2.0.4-1, ovirt-engine-4.5.0.8 | Doc Type: | Enhancement |
| Doc Text: |
The following key-value pairs were added to the KVM dictionary, in the ovirt_template module for importing a template from OVA:
* URL, for example, qemu:///system
* storage_domain for converted disks
* host from which the template is imported
* clone to regenerate imported template's identifiers
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-07-14 12:55:59 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: | |||
| Bug Depends On: | 1941581, 1971317 | ||
| Bug Blocks: | |||
|
Description
amashah
2021-03-10 15:26:15 UTC
Hi, currently, we are not able to import the template from ova via API it might have required some changes. Ori could you please check maybe it could be added to the API? I added PR on the collection which solves what the users request but it creates the VM from the ova image and then creates a template. @amashah , can you please clarify what is requested here, is it (1) to ask ovirt-engine/RHVM to import a template from a specified location that the hosts can access as with the UI (2) to upload an OVA you have at hand (locally, on the client side) to ovirt-engine/RHVM as with the above mentioned SDK example Those are not the same as since both the UI and SDK examples were mentioned, I'm a bit confused We are past 4.5.0 feature freeze, please re-target. We expected this feature to be implemented in image_template role (as it was mentioned in the bug description) but we found it in the modules.
It failed, see details below.
Used versions:
ovirt-engine-4.5.0.6-0.7.el8ev.noarch
ovirt-ansible-collection-2.0.3-1.el8ev.noarch
Reproduction steps
1. We couldn't export template as OVA [1] so we exported VM as OVA which worked.
2. We used:
---
- name: oVirt image template
hosts: localhost
connection: local
gather_facts: false
tasks:
- ovirt_auth:
url: https://<engine-fqdn>/ovirt-engine/api
username: admin@internal
ca_file: /etc/pki/ovirt-engine/ca.pem
password: password
- name: Import external ova template
ovirt.ovirt.ovirt_template:
cluster: golden_env_mixed_1
name: Bla
state: present
timeout: 1800
poll_interval: 30
kvm:
host: host_mixed_1
url: ova:///tmp/Bla.ova
storage_domain: nfs_0
auth: "{{ovirt_auth}}"
collections:
- ovirt.ovirt
TASK [Import external ova template] ********************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Internal Engine Error]". HTTP response code is 400.
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Fault reason is \"Operation Failed\". Fault detail is \"[Internal Engine Error]\". HTTP response code is 400."}
In engine.log:
2022-05-09 17:38:30,449+03 ERROR [org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor] (default task-85) [286921d1-a776-455d-b469-374c22eb340f] Exception: Permission denied
2022-05-09 17:38:30,449+03 ERROR [org.ovirt.engine.core.bll.GetVmTemplateFromOvaQuery] (default task-85) [286921d1-a776-455d-b469-374c22eb340f] Query 'GetVmTemplateFromOvaQuery' failed: For input string: ""
2022-05-09 17:38:30,449+03 ERROR [org.ovirt.engine.core.bll.GetVmTemplateFromOvaQuery] (default task-85) [286921d1-a776-455d-b469-374c22eb340f] Exception: java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:662)
at java.base/java.lang.Integer.valueOf(Integer.java:983)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleRunnerHttpClient.getLastEventId(AnsibleRunnerHttpClient.java:117)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor.runCommand(AnsibleExecutor.java:185)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor.runCommand(AnsibleExecutor.java:102)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor.runCommand(AnsibleExecutor.java:94)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.GetFromOvaQuery.runAnsibleQueryOvaInfoPlaybook(GetFromOvaQuery.java:68)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.GetFromOvaQuery.executeQueryCommand(GetFromOvaQuery.java:43)
...
2022-05-09 17:38:30,455+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-85) [] Operation Failed: [Internal Engine Error]
The other error [1] when we tried to export the template as OVA:
2022-05-09 17:27:28,979+03 ERROR [org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor] (default task-82) [3ecfc56e-404c-4384-967a-917023fcbf0a] Exception: Permission denied
2022-05-09 17:27:28,979+03 ERROR [org.ovirt.engine.core.bll.exportimport.ExportVmTemplateToOvaCommand] (default task-82) [3ecfc56e-404c-4384-967a-917023fcbf0a] Error during ValidateFailure.: java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:662)
at java.base/java.lang.Integer.valueOf(Integer.java:983)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleRunnerHttpClient.getLastEventId(AnsibleRunnerHttpClient.java:117)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor.runCommand(AnsibleExecutor.java:185)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor.runCommand(AnsibleExecutor.java:75)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.common.utils.ansible.AnsibleExecutor.runCommand(AnsibleExecutor.java:52)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.exportimport.ExportOvaCommand.validateTargetFolder(ExportOvaCommand.java:113)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.exportimport.ExportOvaCommand.validate(ExportOvaCommand.java:90)
at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.exportimport.ExportVmTemplateToOvaCommand.validate(ExportVmTemplateToOvaCommand.java:76)
...
Moving to 4.5.1, too late to fix on 4.5.0-1 I was not able to reproduce this issue on engine: 4.5.0.8-1.el8 ovirt-ansible-collection: 2.0.4-1 Could you please try the template import again? Looking at the log looks like an engine/AR issue. Verified in ovirt-ansible-collection-2.0.4-1.el8ev.noarch, ovirt-engine-4.5.1-0.62.el8ev.noarch 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 (RHV Engine and Host Common Packages 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/RHBA-2022:5584 Due to QE capacity, we are not going to cover this issue in our automation |