Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1692341

Summary: Template import as OVA failed if the source VM of exported OVA file is in the environment.
Product: [oVirt] ovirt-engine Reporter: Nisim Simsolo <nsimsolo>
Component: BLL.VirtAssignee: Michal Skrivanek <michal.skrivanek>
Status: CLOSED DUPLICATE QA Contact: meital avital <mavital>
Severity: high Docs Contact:
Priority: unspecified    
Version: futureCC: bugs, nsimsolo, rbarry
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-27 11:58:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine.log
none
vdsm.log none

Description Nisim Simsolo 2019-03-25 12:15:47 UTC
Description of problem:
Trying to import OVA as template while the OVA source VM is still in the environment, failed with the next engine.log:
2019-03-25 14:06:38,466+02 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmTemplateFromOvaCommand] (EE-ManagedThreadFactory-engine-Thread-1809) [67ddd498-8c62-47f5-9cfb-
698194c702e2] Exception: org.springframework.dao.DuplicateKeyException: CallableStatementCallback; SQL [{call insertvmtemplate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}ERROR: dup
licate key value violates unique constraint "pk_vm_static"
  Detail: Key (vm_guid)=(6c6a2287-c1fd-42b3-95c0-4d6220ec35ee) already exists.

Importing this OVA as template is possible after removing the source VM from the environment.

Version-Release number of selected component (if applicable):
ovirt-engine-4.4.0-0.0.master.20190323132107.git181b8fe.el7
libvirt-client-4.5.0-10.el7_6.6.x86_64
qemu-kvm-ev-2.12.0-18.el7_6.3.1.x86_64
vdsm-4.40.0-114.git8e34445.el7.x86_64
sanlock-3.6.0-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create VM and export it as OVA.
2. From WebAdmin -> Compute -> templates, import dialog, select OVA and try to import exported OVA file.
3.

Actual results:
Template import as OVA failed.

Expected results:


Additional info:
engine.log and vdsm.log attached

Comment 1 Nisim Simsolo 2019-03-25 12:17:05 UTC
Created attachment 1547680 [details]
engine.log

Comment 2 Nisim Simsolo 2019-03-25 12:17:33 UTC
Created attachment 1547681 [details]
vdsm.log

Comment 3 Ryan Barry 2019-03-27 11:58:45 UTC

*** This bug has been marked as a duplicate of bug 1692332 ***