Bug 1366990

Summary: Import from Xen and KVM: import dilaog - VM should not be checked as "clone" when there is identical VM name in a different DC.
Product: [oVirt] ovirt-engine Reporter: Nisim Simsolo <nsimsolo>
Component: BLL.VirtAssignee: Sharon Gratch <sgratch>
Status: CLOSED NOTABUG QA Contact: Nisim Simsolo <nsimsolo>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.2.6CC: bugs, mgoldboi, nsimsolo, tjelinek
Target Milestone: ovirt-4.0.6Flags: tjelinek: ovirt-4.0.z?
mgoldboi: planning_ack+
rule-engine: devel_ack?
mavital: testing_ack+
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: 2016-11-02 13:51:27 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
vdsm.log
none
engine.log
none
first import dialog
none
second_import_dialog
none
VMware second import dialog (clone is unchecked)
none
KVM second import dialog (clone is checked) none

Description Nisim Simsolo 2016-08-15 08:17:29 UTC
Description of problem:
- When selecting VM to import with an identical name to a VM which exists in different DC, the VM is set to clone in the second import dialog and cannot be imported not as a clone.
- This issue occurs also when importing from KVM environment.
- This Issue does not occur when importing from VMware environment.

Version-Release number of selected component (if applicable):
rhevm-4.0.2.6-0.1.el7ev
libvirt-client-1.2.17-13.el7_2.5.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.16.x86_64
vdsm-4.18.10-1.el7ev.x86_64
sanlock-3.2.4-2.el7_2.x86_64

How reproducible:
Consistently

Steps to Reproduce:
1. Browse webadmin -> Virtual machines tab -> import dialog, enter Xen details.
2. Select VM to import with a name that already exist in a different DC. 
3. move to next dialog.

Actual results:
VM is checked as clone although the identical VM name is in a different DC (see 
second_dialog.png screenshot attached) and VM cannot be imported not as a clone.

Expected results:
VM should not be checked as a clone in the second dialog page.

Additional info:
vdsm.log, engine.log and screenshots attached.

Comment 1 Nisim Simsolo 2016-08-15 08:17:55 UTC
Created attachment 1190809 [details]
vdsm.log

Comment 2 Nisim Simsolo 2016-08-15 08:19:05 UTC
Created attachment 1190810 [details]
engine.log

Comment 3 Nisim Simsolo 2016-08-15 08:20:37 UTC
Created attachment 1190811 [details]
first import dialog

Comment 4 Nisim Simsolo 2016-08-15 08:21:44 UTC
Created attachment 1190812 [details]
second_import_dialog

Comment 5 Nisim Simsolo 2016-08-15 08:23:00 UTC
Created attachment 1190813 [details]
VMware second import dialog (clone is unchecked)

Comment 6 Nisim Simsolo 2016-08-15 08:23:56 UTC
Created attachment 1190814 [details]
KVM second import dialog (clone is checked)

Comment 7 Sharon Gratch 2016-11-02 13:49:05 UTC
It is not a bug. Details:
A VM is marked as clone only if there is another vm in the system that has the SAME id, regardless to the data center it belongs to. The VM is is unique cross DCs.

So for XEN and KVM it work as expected in the attached tests because trying to import a VM that is already existed with the same id in the system (under other data center) should mark the VM as cloned.

For VMware it should work the same and it does. 

The reason it wasn't marked as clone in the attached test is that the existed VM had an id started with fb0f..... and the imported VM had an id started with 423c8...so those are 2 different VMS with the same name (see "VMware_second_dialog" attachment).

to summarize there are 2 scenarios:
1) import a VM with the same id as one existed in the system -> in this case the VM is marked to be imported as clone.

2) import a VM with the same name as other VM existed under a different dc, but with a different id -> in this case it will be imported as is (not marked as clone)