Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 855627

Summary: Wrong template name is shown when creating vm from template.
Product: Red Hat Enterprise Virtualization Manager Reporter: Barak Dagan <bdagan>
Component: ovirt-engine-webadmin-portalAssignee: Roy Golan <rgolan>
Status: CLOSED NOTABUG QA Contact: Barak Dagan <bdagan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: dyasny, ecohen, hateya, iheim, michal.skrivanek, mkenneth, oramraz, pstehlik, Rhev-m-bugs, tjelinek, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-20 22:32:13 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:
Attachments:
Description Flags
screen shot
none
vdsm log (puma32) none

Description Barak Dagan 2012-09-09 12:25:24 UTC
Description of problem:
When craeting VM from template using the GUI, the template name under VM -> General is blank. Note that the right name presented when using the CLI.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Oded Ramraz 2012-09-09 12:35:58 UTC
Did you check the value in DB? it might be an engine issue .

Comment 3 Barak Dagan 2012-09-10 07:30:53 UTC
Created attachment 611329 [details]
screen shot

Comment 4 Barak Dagan 2012-09-10 07:44:31 UTC
Created attachment 611335 [details]
vdsm log (puma32)

Comment 5 Barak Dagan 2012-09-10 07:46:19 UTC
Comment on attachment 611335 [details]
vdsm log (puma32)

in this log can be foundn that VMs created from GUI has <TemplateName>Blank</TemplateName>
while VM created from CLI has <TemplateName>fire-rh-template</TemplateName>

Comment 6 Barak Dagan 2012-09-10 13:24:24 UTC
(In reply to comment #1)
> Did you check the value in DB? it might be an engine issue .

engine=# select vm.vm_name, vm.vmt_guid, vm.vm_description from server_vms vm;
    vm_name    |               vmt_guid               | vm_description  
---------------+--------------------------------------+-----------------
 w7-temp       | 00000000-0000-0000-0000-000000000000 | 
 fire-rh1-cli  | b71a32a9-5443-4961-bfb3-67f9028142d1 | 
 fire-temp-gui | 00000000-0000-0000-0000-000000000000 | 
 fire-w72      | 00000000-0000-0000-0000-000000000000 | 2nd w7 template
 fire-rh2      | 00000000-0000-0000-0000-000000000000 | 1st template VM

its the blank template in the DB. (can be seen also frmo the log file)

Comment 7 Roy Golan 2012-09-12 09:45:14 UTC
can you specify the steps to reproduce for both UI and REST(or CLI)?

Comment 9 Tomas Jelinek 2012-09-18 06:55:02 UTC
It seems to be intentional for some reason. In AddVmFromTemplateCommand.ExecuteVmCommand() the template is intentionally overridden to Blank. There is also a comment:

// override template id to blank
...
getVm().setvmt_guid(VmTemplateHandler.BlankVmTemplateId);
...

but I don't know why. Any ideas what is the reason? Maybe it is not a bug but a feature.

Comment 10 Itamar Heim 2012-09-20 22:32:13 UTC
this isn't a bug. its by design.
the vm created was a server.
default for server is to clone the disks.
so the disks are no longer based on the template, since they were cloned.

we only keep the template today if the VM is still derived from the template (which also prevents deleting the template).

Comment 11 Barak Dagan 2012-09-23 07:46:11 UTC
(In reply to comment #10)
> this isn't a bug. its by design.
> the vm created was a server.
> default for server is to clone the disks.
> so the disks are no longer based on the template, since they were cloned.
> 
> we only keep the template today if the VM is still derived from the template
> (which also prevents deleting the template).

Creating a new VM from RESTapi (or CLI), will keep the template name, I would expect the same behaviour in both routes: UI and RESTapi

Comment 12 Itamar Heim 2012-09-23 07:59:08 UTC
was the VM from CLI created as thin or clone?
the CLI does not have default behaviors like the ui has