Bug 1375379

Summary: VM names not updating on host side after being renamed from RHEV manager GUI.
Product: Red Hat Enterprise Virtualization Manager Reporter: Ribu Tho <rabraham>
Component: ovirt-engineAssignee: Arik <ahadas>
Status: CLOSED ERRATA QA Contact: Israel Pinto <ipinto>
Severity: high Docs Contact:
Priority: medium    
Version: 3.6.4CC: ahadas, bazulay, bgraveno, lsurette, mavital, mgoldboi, michal.skrivanek, mkalinin, rabraham, rbalakri, Rhev-m-bugs, srevivo, tjelinek, ycui, ykaul, ylavi
Target Milestone: ovirt-4.1.0-beta   
Target Release: ---   
Hardware: noarch   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, Red Hat Virtualization Manager allowed you to rename a virtual machine while it was running. The change was applied immediately in the Manager and the running virtual machine was unchanged. This would cause that you would be unable to start another virtual machine with the original name on the same host. This update ensures that a running virtual machine name change is applied only when the virtual machine next starts.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-25 00:51: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:

Description Ribu Tho 2016-09-12 23:46:56 UTC
Description of problem:

The VM name redhatguest was updated to redhatguest-123 from RHEV GUI . After this a new VM called redhatguest  was created and when trying to start redhatguest , results in the error 

" VM redhatguest is down with error. Exit message: operation failed: domain 'redhatguest' already exists with uuid baab17f5-775a-49a5-9973-2f91dfd43b84."

Version-Release number of selected component (if applicable):

vdsm-4.17.28-0.el7ev.noarch
vdsm-cli-4.17.28-0.el7ev.noarch

How reproducible:


Steps to Reproduce:

1. Start a VM called test  and rename it to test-123 on the run when its up and running via RHEV GUI .

2. Create a new VM with name test again . 

3. Trying to start gives the error above . 


Actual results:

The VM test fails to start because it complains another VM with same VM UUID runs on the server.

When checking the host for vdsClient_-s_0_getAllVmStats  , it shows that test still exists and was not renamed to test-123 even though the UUID is different for both the VM guests. 

Expected results:

The VM name was to updated on the host that its running on at the moment which was not the case. 

Additional info:

Comment 2 Dan Kenigsberg 2016-09-13 06:36:31 UTC
VM rename takes place on host only when the VM is restarted. Engine should be aware of that, and not allow re-using of a currently-running VM.

Comment 9 Michal Skrivanek 2016-09-15 14:57:18 UTC
The VM name should be added to the list of fields which require a VM restart. That way there would be a pending change indication

Comment 10 Arik 2016-09-18 10:34:26 UTC
(In reply to Michal Skrivanek from comment #9)
Right, but that will be a bit more complicated than just changing the setting of the 'name' field. Consider the following case:
1. You run a VM called 'A'
2. You rename this VM to 'B'
3. You create another VM called 'B'

After #2 the name 'B' is contained only in the next-run snapshot so in order to prevent #3 from happening, not only that we need to check engine-locks and entries in vm_static but also the configuration of next-run snapshots (xml format in the 'snapshot' table) when checking name validity.

Comment 11 Yaniv Kaul 2016-09-18 10:50:24 UTC
(In reply to Arik from comment #10)
> (In reply to Michal Skrivanek from comment #9)
> Right, but that will be a bit more complicated than just changing the
> setting of the 'name' field. Consider the following case:
> 1. You run a VM called 'A'
> 2. You rename this VM to 'B'
> 3. You create another VM called 'B'
> 
> After #2 the name 'B' is contained only in the next-run snapshot so in order
> to prevent #3 from happening, not only that we need to check engine-locks
> and entries in vm_static but also the configuration of next-run snapshots
> (xml format in the 'snapshot' table) when checking name validity.

Yet another reason why my suggestion in comment 8 makes sense.

Comment 12 Arik 2016-09-18 11:13:21 UTC
(In reply to Yaniv Kaul from comment #11)
> Yet another reason why my suggestion in comment 8 makes sense.

I agree, but why both name and UUID and not only UUID?
It seems that we currently have a bug in getting the pid of the VM in the engine, but assuming we can present its pid to ease the identification of the qemu-process I see no reason not to use just the UUID

Comment 13 Yaniv Kaul 2016-09-18 11:34:58 UTC
(In reply to Arik from comment #12)
> (In reply to Yaniv Kaul from comment #11)
> > Yet another reason why my suggestion in comment 8 makes sense.
> 
> I agree, but why both name and UUID and not only UUID?
> It seems that we currently have a bug in getting the pid of the VM in the
> engine, but assuming we can present its pid to ease the identification of
> the qemu-process I see no reason not to use just the UUID

Names are user friendly, makes debugging easier.
It'll be also easier for monitoring purposes (otherwise, VDSM has no idea what the VM name is and need a query to engine from somewhere).

Comment 14 Yaniv Lavi 2016-09-19 14:45:30 UTC
(In reply to Yaniv Kaul from comment #13)
> (In reply to Arik from comment #12)
> > (In reply to Yaniv Kaul from comment #11)
> > > Yet another reason why my suggestion in comment 8 makes sense.
> > 
> > I agree, but why both name and UUID and not only UUID?
> > It seems that we currently have a bug in getting the pid of the VM in the
> > engine, but assuming we can present its pid to ease the identification of
> > the qemu-process I see no reason not to use just the UUID
> 
> Names are user friendly, makes debugging easier.
> It'll be also easier for monitoring purposes (otherwise, VDSM has no idea
> what the VM name is and need a query to engine from somewhere).

I don't like the option of ugly name.
And this will not solve the issue for metrics. 
Why not change it on the host?

Comment 15 Yaniv Kaul 2016-09-19 14:58:51 UTC
I do like the idea,  I don't think it is ugly and it gives a good solution to the metrics,  soI don't see what the issue is. 
Changing it on the host is another verb,  probably not very difficult I reckon,  but we'll need to see how libvirt handles it (even their log files are based on domain names).

Comment 16 Michal Skrivanek 2016-09-20 09:49:15 UTC
(In reply to Arik from comment #10)
> (In reply to Michal Skrivanek from comment #9)
> Right, but that will be a bit more complicated than just changing the
> setting of the 'name' field. Consider the following case:
> 1. You run a VM called 'A'
> 2. You rename this VM to 'B'
> 3. You create another VM called 'B'
> 
> After #2 the name 'B' is contained only in the next-run snapshot so in order
> to prevent #3 from happening, not only that we need to check engine-locks
> and entries in vm_static but also the configuration of next-run snapshots
> (xml format in the 'snapshot' table) when checking name validity.

Yes, until the stop of 'A' the 'B' wouldn't  be able to start (on the same host). Sure, but why would we mind?
I do not believe pure UUID is a better solution as you can change it the same way as a name - it's a configurable field.
IF we use UUID+name - then you end up with different "rows" fro metrics each time you change either of those fields...it may make sense, but it can also be annoying.
That's why I'm much more in favor to not change anything and keep it as is with comment #9 to make it a bit more obvious.

Comment 17 Arik 2016-09-21 06:32:52 UTC
(In reply to Michal Skrivanek from comment #16)
> I do not believe pure UUID is a better solution as you can change it the
> same way as a name - it's a configurable field.

You can set the initial value of this field while creating a VM or ask to generate one by cloning a VM, but once the VM is created - the UUID cannot be changed.

Comment 18 Michal Skrivanek 2016-10-12 09:32:07 UTC
so, what's the outcome?

Comment 23 meital avital 2017-02-10 09:03:34 UTC
verified on version: 4.1.0.3-0.1.el7

1. run a VM called 'A'
2. rename this VM to 'B' -> Icon appears on the VM, which require a VM restart. That way there would be a pending change indication 
3. create another VM called 'B' -> Warning appears - 'Name is already used the environment, create new unique name'