Bug 1531062

Summary: virt-v2v: renamed VM cannot be imported as clone if origin VM name is already exist in DC.
Product: [oVirt] ovirt-engine Reporter: Nisim Simsolo <nsimsolo>
Component: BLL.VirtAssignee: Sharon Gratch <sgratch>
Status: CLOSED CURRENTRELEASE QA Contact: Nisim Simsolo <nsimsolo>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.0.2CC: bugs, lveyde, mavital, mtessun, nsimsolo, sgratch
Target Milestone: ovirt-4.2.2Flags: rule-engine: ovirt-4.2+
mtessun: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.2.4 Doc Type: Bug Fix
Doc Text:
Cause: renaming a vm failed due to a bug in v2v dialogs. Consequence: renaming a cloned vm failed and therefore importing a cloned vm was impossible in case origin vm name already existed in DC. Fix + result: Please see doc text for bug 1529248
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-29 10:55:39 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:
Bug Depends On:    
Bug Blocks: 1049604    
Attachments:
Description Flags
engine.log look at 2018-01-04 15:11:25,524+02
none
Webamdin import dialog none

Description Nisim Simsolo 2018-01-04 13:40:47 UTC
Description of problem:
Trying to import VM as clone, when the same origin VM name already exist in DC but the imported VM name has been renamed, is rejected by Webadmin with the next pop-up error:

centos44%/\&+=?!@#$^*()[]:
Import VM failed - VM Name already exist in the Data Center. Please rename the VM in the Data Center first

and the next engine.log:

2018-01-04 15:11:25,524+02 WARN  [org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand] (default task-18) [] Validation of action 'ImportVmFromExternalProvider' failed for user admin@internal-authz. Reasons: VAR__ACTION__IMPORT,VAR__TYPE__VM,VM_CANNOT_IMPORT_VM_NAME_EXISTS



Version-Release number of selected component (if applicable):
rhvm-4.2.0.2-0.1.el7.noarch
qemu-kvm-rhev-2.9.0-16.el7_4.13.x86_64
sanlock-3.5.0-1.el7.x86_64
libvirt-client-3.2.0-14.el7_4.5.x86_64
vdsm-4.20.9.3-1.el7ev.x86_64
virt-v2v-1.36.3-6.el7_4.3.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Browse Webadmin -> compute -> VMs -> more button -> import dialog
2. Enter external provider details, click "load" button and select VM which already exist in DC.
3. Verify clone is checked, rename VM name and click ok button

Actual results:
Action failed

Expected results:
Import should not be rejected when importing VM as clone and renaming it if there's the same origin VM name in the DC

Additional info:
Issue is also relevant for OVA import.

engine.log and screenshot attached

Comment 1 Nisim Simsolo 2018-01-04 13:44:36 UTC
Created attachment 1376945 [details]
engine.log look at 2018-01-04 15:11:25,524+02

Comment 2 Nisim Simsolo 2018-01-04 13:45:07 UTC
Created attachment 1376946 [details]
Webamdin import dialog

Comment 3 Michal Skrivanek 2018-02-07 12:23:14 UTC
is it the same issue with changes not applied?

Comment 4 Sharon Gratch 2018-03-06 17:10:25 UTC
(In reply to Michal Skrivanek from comment #3)
> is it the same issue with changes not applied?

Yes, it is the same issue as in bug 1529248.

Comment 5 Nisim Simsolo 2018-03-18 10:10:38 UTC
Verification builds:
rhvm-4.2.2.4-0.1.el7
vdsm-4.20.22-1.el7ev.x86_64
virt-v2v-1.36.10-6.el7.x86_64
libvirt-client-3.9.0-14.el7.x86_64

Verification scenario:
1. Import VMs as clone from VMware, Xen and KVM environments
2. Import VMware OVA and RHV OVA as clone
3. Verify VMs imported successfully.
4. Run VMs and verify VMs are running.

Comment 6 Sandro Bonazzola 2018-03-29 10:55:39 UTC
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.