Bug 1717399

Summary: [RFE] - ability to run 2 guest with the same name on one host (qemu process will not contain vm name just uuid)
Product: Red Hat Enterprise Linux 7 Reporter: Marian Jankular <mjankula>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.6CC: berrange
Target Milestone: rcKeywords: FutureFeature
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-06-05 12:41:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marian Jankular 2019-06-05 12:17:54 UTC
Description of problem:
ability to run 2 guest with the same name on one host (qemu process will not contain vm name just uuid)
Version-Release number of selected component (if applicable):
libvirt-4.5.0-10.el7_6.3.x86_64

How reproducible:
everytime

Steps to Reproduce:

1. create with name vmA on hostA
2. rename vmA while vm is running to vmA-1
3. create vm with name vmA on hostB
4. try to migrate vmA from hostB to hostA

Actual results:
migration fail with error:
libvirtError: operation failed: domain 'vmA' already exists with uuid b1486f27-ece8-49f2-9ed7-fc89cc147b30

Expected results:
vms will not contain the vm name just uuid of the vm thus migration will succeed

Additional info:

Comment 3 Daniel Berrangé 2019-06-05 12:41:21 UTC
When running QEMU has a number of files on disk whose filename is based on the VM name. You can't have two QEMUs using the same filename concurrently, eg for QEMU monitor socket, so we must forbid having two guests with same the name. In addition from an mgmt application POV, the name has long been considered to be a unique identifier scoped to a host. If libvirt allowed 2 Vms with the same name it would break mgmt apps using name as unique identifier.