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):
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.
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.
VM should not be checked as a clone in the second dialog page.
vdsm.log, engine.log and screenshots attached.
Created attachment 1190809 [details]
Created attachment 1190810 [details]
Created attachment 1190811 [details]
first import dialog
Created attachment 1190812 [details]
Created attachment 1190813 [details]
VMware second import dialog (clone is unchecked)
Created attachment 1190814 [details]
KVM second import dialog (clone is checked)
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)