Created attachment 1384729 [details] Events - Failed to import Description of problem: Failed to import from external provider (vmware/kvm/ova file) with REST API. From the UI the imports works fine. Version-Release number of selected component (if applicable): Engine Version:4.2.1.2-0.1.el7 Host: OS Version: RHEL - 7.4 - 18.el7 Kernel Version:3.10.0 - 693.17.1.el7.x86_64 KVM Version:2.9.0 - 16.el7_4.14 LIBVIRT Version:libvirt-3.2.0-14.el7_4.7 VDSM Version:vdsm-4.20.14-1.el7ev SPICE Version:0.12.8 - 2.el7.1 Kernel Features: PTI: 1, IBPB: 0, IBRS: 0 How reproducible: 100% Steps to Reproduce: Import vm from external provider (vmware/kvm/ova) with REST Actual results: All imports failed. Expected results: Additional info: 2018-01-23 09:58:03,584+02 INFO [org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand] (default task-22) [3f9042ec] Lock Acquired to object 'EngineLock:{exclusiveLocks='[3925fa13-59d4-4e99-a4b2-a0ffae4c9890=VM, test_v2v_rhel_7_2_automation_kvm=VM_NAME]', sharedLocks=''}' NPE: 2018-01-23 09:58:03,759+02 INFO [org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand] (default task-22) [] Running command: ImportVmFromExternalProviderCommand internal: true. Entities affected : ID: 239f4c0f-92cd-453a-8b51-b38bcc17bba1 Type: StorageAction group IMPORT_EXPORT_VM with role type ADMIN 2018-01-23 09:58:03,805+02 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand] (default task-22) [] Command 'org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand' failed: null 2018-01-23 09:58:03,806+02 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand] (default task-22) [] Exception: java.lang.NullPointerException at org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.buildAddDiskParameters(ImportVmFromExternalProviderCommand.java:324) [bll.jar:] at org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.createDisk(ImportVmFromExternalProviderCommand.java:302) [bll.jar:] at org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand.processImages(ImportVmFromExternalProviderCommand.java:265) [bll.jar:] at org.ovirt.engine.core.bll.exportimport.ImportVmCommandBase.executeVmCommand(ImportVmCommandBase.java:476) [bll.jar:] at org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:161) [bll.jar:] at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1133) [bll.jar:] at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1275) [bll.jar:] at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1924) [bll.jar:] at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:164) [utils.jar:] at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:103) [utils.jar:] at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1335) [bll.jar:] at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:400) [bll.jar:] at org.ovirt.engine.core.bll.executor.DefaultBackendActionExecutor.execute(DefaultBackendActionExecutor.java:13) [bll.jar:] at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:468) [bll.jar:] at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:450) [bll.jar:] at org.ovirt.engine.core.bll.Backend.runInternalAction(Backend.java:656) [bll.jar:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151] at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151] at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509) at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:78) at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:88)
Created attachment 1384731 [details] engine_logs
automation test with import from vmware/kvm/ova https://rhv-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/rhv-4.2-ge-runner-compute/385/
Sharon, note that when importing from rest-api the VM is created as a new-entity which means it will be assigned with a new ID [1]. Therefore we will not be able to find a DiskVmElement that corresponds to the new ID on the images and we fail with NPE on [2]. So now that DiskVmElements are created while querying the VM, we need to adjust them when the VM is imported as a new entity. [1] https://github.com/oVirt/ovirt-engine/blob/ovirt-engine-4.2.1.2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/exportimport/ImportVmFromExternalUrlCommand.java#L130 [2] https://github.com/oVirt/ovirt-engine/blob/ovirt-engine-4.2.1.2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/exportimport/ImportVmFromExternalProviderCommand.java#L324
Verify with: Engine Software Version:4.2.1.6-0.1.el7 Host: OS Version:RHEL - 7.5 - 6.el7 Kernel Version:3.10.0 - 851.el7.x86_64 KVM Version:2.9.0 - 16.el7_4.13.1 LIBVIRT Version:libvirt-3.9.0-13.el7 VDSM Version:vdsm-4.20.18-1.el7ev Steps: Export ova and import it Results: OVA imported successfully
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018. Since the problem described in this bug report should be resolved in oVirt 4.2.2 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.