Description of problem: Trying to import OVA as template failed with engine.log: 2019-04-30 11:59:37,029+03 ERROR [org.ovirt.engine.core.bll.GetVmTemplateFromOvaQuery] (default task-3) [83db3dfd-cdfb-4b4a-a068-f6700b463627] Query 'GetVmTemplateFromOvaQuery' failed: EngineException: Failed to query OVA info (Failed with error GeneralException and code 100) 2019-04-30 11:59:37,029+03 ERROR [org.ovirt.engine.core.bll.GetVmTemplateFromOvaQuery] (default task-3) [83db3dfd-cdfb-4b4a-a068-f6700b463627] Exception: org.ovirt.engine.core.common.errors.EngineException: EngineException: Failed to query OVA info (Failed with error GeneralException and code 100) Importing OVA to VM (using the same OVA path) is possible. Version-Release number of selected component (if applicable): ovirt-engine-4.3.3.6-0.1.el7 vdsm-4.30.13-1.el7ev.x86_64 libvirt-4.5.0-10.el7_6.7.x86_64 qemu-kvm-rhev-2.12.0-18.el7_6.4.x86_64 How reproducible: 100% Steps to Reproduce: 1. Browse WebAdmin -> Compute -> templates -> import 2. Select OVA as source, add OVA folder path and click " load" button. 3. Actual results: In WebAdmin, query retrieves nothing and the next message appears: " Failed to load VM configuration from OVA file: /home/nisim/rhv_ova/" In engine.log there's a failure GeneralException and code 100. Expected results: It should be possible to import OVA to template. Additional info: Issue is also relevant for upstream. engine.log and vdsm.log attached.
I don't see the attachments. Missing?
Created attachment 1560665 [details] engine.log
Created attachment 1560666 [details] vdsm.log
attached now. please see engine.log error occurs at 2019-05-01 10:02:25,770+03
I tested this. When I export a VM as an OVA file, it does import successfully as a VM, but fails with the same error as per this issue when attempting to import as a template. If one exports a template as an OVA and then imports the OVA file as a template it succeeds. In debugging the code when importing an OVA, the message sent via the ansible playbook ovirt-ova-query.yml has the entity_type = vm for a VM, but with a template, the entity_type is template. The entity_type is the only real differences between the two messages. Alternatively, if one attempts to import a template OVA file as a VM, then the VM import fails the same way. It seems that VM OVA files need to be imported as VMs and template OVA files need to be imported as templates. Please retest and verify that this is the case.
It is. But, according to https://gerrit.ovirt.org/#/c/92531/ there should be a differentiation between VM OVA and template OVA so it won't be possible to import template OVA from VMs -> OVA import dialog or import VM OVA file from templates -> OVA import dialog.
(In reply to Nisim Simsolo from comment #6) > It is. > But, according to https://gerrit.ovirt.org/#/c/92531/ there should be a > differentiation between VM OVA and template OVA > so it won't be possible to import template OVA from VMs -> OVA import dialog > or import VM OVA file from templates -> OVA import dialog. Yes, so that it is point. I only simulate the error you have when I am importing a VM ova as a template as per your description. So please verify that the ova you are importing is a VM ova and if so, then of cause it is not supported for Template OVA importing. Importing a Template OVA exported as a Template OVA worked fine for me as per my description.
You are correct, importing template OVA from templated dialog is working as expected. but we shouldn't see VM OVA under templates OVA import dialog.
(In reply to Nisim Simsolo from comment #8) > You are correct, importing template OVA from templated dialog is working as > expected. but we shouldn't see VM OVA under templates OVA import dialog. So that is not a defect, but new development request? Or was this a regression and if so in which version did it have the VM OVA under Templates OVA import dialog?
Regression. ovirt-engine-4.3.3.6-0.1.el7 vdsm-4.30.13-1.el7ev.x86_64 libvirt-4.5.0-10.el7_6.7.x86_64 qemu-kvm-rhev-2.12.0-18.el7_6.4.x86_64
In reviewing the code and further testing, this is not a regression. If we only have one VM OVA file in the ova directory and attempt to import as a template, the program works the same as if the directory was empty as per the functionality before Arik's change when the directory is empty. If one exports an existing Template OVA to the directory and then in the import perform the load, the program will skip over the VM OVA, but return with the Template OVA. Therefore changing this would be a redesign. Please verify by testing both with an empty ova directory and with a Template OVA in the directory with the VM OVA. Please also test an older version (I tested 4.2.7) to see that an empty OVA directory yields the same error.
builds: ovirt-engine-4.4.0-0.0.master.20190602135708.gitd0fe1bf.el7 vdsm-4.40.0-310.gitbf1f64f.el7.x86_64 libvirt-4.5.0-10.el7_6.10.x86_64 qemu-kvm-ev-2.12.0-18.el7_6.5.1.x86_64 Reassigning reason: template OVA and VM OVA import dialogs are still behaving incorrectly in some cases: 1. Trying to load template OVA by setting folder from VM OVA import dialog: WebAdmin import dialog failed with message: Failed to find or load the VM or Template configuration from OVA directory and/or file: /home/nisim/ova_templates/ the next ERROR is logged in engine.log: 2019-06-04 14:06:40,506+03 ERROR [org.ovirt.engine.core.bll.GetVmFromOvaQuery] (default task-17) [6bbdc019-9b86-48af-ae3f-c861f768f46a] Exception: org.ovirt.engine.core.common.errors.EngineException: EngineException: Fai led to query OVA info (Failed with error GeneralException and code 100) 2. Setting specific template OVA file (for example: /home/nisim/ova_templates/centos44_temp.ovafrom ) in VM OVA import dialog: .ova file is listed as available for Download. Downloading template OVA failed with engine.log: 2019-06-04 14:09:32,572+03 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmFromOvaCommand] (EE-ManagedThreadFactory-engine-Thread-23425) [3c1200c2-b849-4bac-8554-138044661060] Command 'org.ovirt.engine.core.bll.exportimport.ImportVmFromOvaCommand' failed: CallableStatementCallback; SQL [{call insertvmstatic(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}ERROR: duplicate key value violates unique constraint "pk_vm_static" 3. using mixed folder of VM OVAs and template OVAs in VM OVA import dialog is showing only VM OVA files. which is the expected behavior. 4. Trying to load single VM OVA folder from templates OVA import dialog: WebAdmin import dialog failed with message: Failed to find or load the VM or Template configuration from OVA directory and/or file: /home/nisim/one_ova_file 2019-06-04 14:22:48,319+03 ERROR [org.ovirt.engine.core.bll.GetVmTemplateFromOvaQuery] (default task-20) [5aac8441-f669-4764-909c-cfb2aa528f10] Exception: org.ovirt.engine.core.common.errors.EngineException: EngineExcept ion: Failed to query OVA info (Failed with error GeneralException and code 100) this behavior is also true for folder with many VM OVA files. 5. Setting specific VM OVA file (for example: /home/nisim/rhv_ova/centos44.ova) in templates import OVA dialog : WebAdmin uncaught exception occurred. from engine ui.log: 2019-06-04 14:25:58,504+03 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-20) [] Permutation name: 67045B74D8336947E7409A3559FC441A 2019-06-04 14:25:58,505+03 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-20) [] Uncaught exception: com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'ob' of null 6. Using mixed folder of VM OVAs and template OVAs in templates OVA import dialog is showing only OVA of templates. which is the expected behavior.
Created attachment 1577036 [details] reassigned engine.log
Created attachment 1577037 [details] reassigned ui.log of WebAdmin uncaught exception
Created attachment 1577038 [details] reassigned vdsm.log
(In reply to Nisim Simsolo from comment #15) > builds: > ovirt-engine-4.4.0-0.0.master.20190602135708.gitd0fe1bf.el7 > vdsm-4.40.0-310.gitbf1f64f.el7.x86_64 > libvirt-4.5.0-10.el7_6.10.x86_64 > qemu-kvm-ev-2.12.0-18.el7_6.5.1.x86_64 > > Reassigning reason: > template OVA and VM OVA import dialogs are still behaving incorrectly in > some cases: > > 1. Trying to load template OVA by setting folder from VM OVA import dialog: > WebAdmin import dialog failed with message: Failed to find or load the VM or > Template configuration from OVA directory and/or file: > /home/nisim/ova_templates/ > the next ERROR is logged in engine.log: > 2019-06-04 14:06:40,506+03 ERROR > [org.ovirt.engine.core.bll.GetVmFromOvaQuery] (default task-17) > [6bbdc019-9b86-48af-ae3f-c861f768f46a] Exception: > org.ovirt.engine.core.common.errors.EngineException: EngineException: Fai > led to query OVA info (Failed with error GeneralException and code 100) > > 2. Setting specific template OVA file (for example: > /home/nisim/ova_templates/centos44_temp.ovafrom ) in VM OVA import dialog: > .ova file is listed as available for Download. > Downloading template OVA failed with engine.log: > 2019-06-04 14:09:32,572+03 ERROR > [org.ovirt.engine.core.bll.exportimport.ImportVmFromOvaCommand] > (EE-ManagedThreadFactory-engine-Thread-23425) > [3c1200c2-b849-4bac-8554-138044661060] Command > 'org.ovirt.engine.core.bll.exportimport.ImportVmFromOvaCommand' failed: > CallableStatementCallback; SQL [{call insertvmstatic(?, ?, ?, ?, ?, ?, ?, ?, > ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, > ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, > ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}ERROR: duplicate key value > violates unique constraint "pk_vm_static" > > 3. using mixed folder of VM OVAs and template OVAs in VM OVA import dialog > is showing only VM OVA files. which is the expected behavior. > > 4. Trying to load single VM OVA folder from templates OVA import dialog: > WebAdmin import dialog failed with message: Failed to find or load the VM or > Template configuration from OVA directory and/or file: > /home/nisim/one_ova_file > 2019-06-04 14:22:48,319+03 ERROR > [org.ovirt.engine.core.bll.GetVmTemplateFromOvaQuery] (default task-20) > [5aac8441-f669-4764-909c-cfb2aa528f10] Exception: > org.ovirt.engine.core.common.errors.EngineException: EngineExcept > ion: Failed to query OVA info (Failed with error GeneralException and code > 100) > > this behavior is also true for folder with many VM OVA files. > > 5. Setting specific VM OVA file (for example: > /home/nisim/rhv_ova/centos44.ova) in templates import OVA dialog : > WebAdmin uncaught exception occurred. > from engine ui.log: > 2019-06-04 14:25:58,504+03 ERROR > [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default > task-20) [] Permutation name: 67045B74D8336947E7409A3559FC441A > 2019-06-04 14:25:58,505+03 ERROR > [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default > task-20) [] Uncaught exception: > com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read > property 'ob' of null > > 6. Using mixed folder of VM OVAs and template OVAs in templates OVA import > dialog is showing only OVA of templates. which is the expected behavior. As per previous comments, we do not support mixing so one cannot import a Template as a VM, nor can one import a VM as a Template. So we will obtain the exception if: 1. The OVA directory is empty for either importing VMs or Templates. 2. The OVA directory only has Templates and we are importing VMs (after filtering the Templates there are no files to import so it considers it an empty directory). 3. The OVA directory only has VMs and we are importing Templates (after filtering the VMS there are no files to import so it considers it an empty directory). This covers tests 1, 3, 4, and 6. So all are expected behavior. Tests 2 and 5 are not really supported, because as the dialog states the the Text box expects a "File Path" not a file name. We are only supporting folders here, not files. The only real issue here is handling these scenarios more gracefully, but that should not be high priority nor a simple bug fix, but new development work involving infrastructure changes. We agreed to just change the wording of the message and this is what is reflected in the logs and tested. Therefore all that was changed was the wording of the message and one can see this in the message "Failed to find or load the VM or Template configuration from OVA directory and/or file". The exception is just the mechanism that unwinds the stack when handling the scenario. The question is whether we want to spend the time redesigning the functionality.
As per Tal's comment on: https://gerrit.ovirt.org/#/c/100960/ "Please clone the bug to downstream and use the new Bug-Url in the commit message" Tal states it is a manager/team lead process.
No need
(In reply to Steven Rosenberg from comment #20) > As per Tal's comment on: https://gerrit.ovirt.org/#/c/100960/ > > "Please clone the bug to downstream and use the new Bug-Url in the commit > message" > > Tal states it is a manager/team lead process. To clarify, no customer case, no need for a d/s clone
Verified: rhvm-4.3.5.2-0.1.el7 vdsm-4.30.22-1.el7ev.x86_64 virt-v2v-1.40.2-5.el7.x86_64 libvirt-4.5.0-23.el7.x86_64 qemu-kvm-rhev-2.12.0-33.el7.x86_64 Verification scenario: Polarion test case added to external trackers
This bugzilla is included in oVirt 4.3.5 release, published on July 30th 2019. Since the problem described in this bug report should be resolved in oVirt 4.3.5 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.