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

Bug 1093501

Summary: [virt] update of a template does not update the vms in the pool set to latest sub version
Product: Red Hat Enterprise Virtualization Manager Reporter: Marina Kalinin <mkalinin>
Component: ovirt-engineAssignee: Omer Frenkel <ofrenkel>
Status: CLOSED INSUFFICIENT_DATA QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: high    
Version: 3.4.0CC: acathrow, gklein, iheim, lpeer, mavital, michal.skrivanek, mkalinin, ofrenkel, Rhev-m-bugs, sherold, yeylon
Target Milestone: ---   
Target Release: 3.4.2   
Hardware: All   
OS: Linux   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-01 13:34:31 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:
Bug Depends On:    
Bug Blocks: 1072347    

Description Marina Kalinin 2014-05-01 22:41:24 UTC
Description of problem:
An update of a template does not update the vms in the pool set to latest sub version. 
Reading this: http://www.ovirt.org/Features/Template_Versions
I understand, that if I set a pool property template sub version to be latest, once I update the template, all the vms in that pool (automatic pool) would be updated to the latest version. But this is not happening.

Version-Release number of selected component (if applicable):
http://www.ovirt.org/Features/Template_Versions


Steps to Reproduce:
1. Create vm rhel7.
2. Create a template rhel7_tmpl based on this vm.
3. Create a pool based on this template, choose template subversion to be latest, with 1 VM. Confirm, pool type set to automatic.
4. Wait until rhel7_pool_1 vm is created.
5. Edit the original VM rhel7 and create a file inside that vm: 
# touch test_file
6. Prepare a new template from rhel7 updated VM, set it to be a subversion of rhel7_tmpl.
7. Wait until the creation of the template is finished.
8. Start rhel7_pool_1 vm and run ll command in it to check if the file is present.

Actual results:
The new file test_file created before the second template is not there.

Expected results:
The new file test_file should be there, since the pool is set to "latest" sub version.

Additional info:
I created another pool from that latest template and it contained the file. So that the template created properly.

Comment 1 Omer Frenkel 2014-05-04 06:36:16 UTC
please attach engine log, also did you try to stop and start the vm?

Comment 2 Marina Kalinin 2014-05-05 14:06:38 UTC
The VM was stopped while the template got updated.
I will check the logs now.

Comment 4 Omer Frenkel 2014-06-08 16:10:04 UTC
looking at the log its clear that the pool was create after the latest version already created:

2014-05-01 18:25:10,594 INFO  [org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand] (org.ovirt.thread.pool-4-thread-50) [55a2b91a] Running command: AddVmPoolWithVmsCommand internal: false. Entities affected :  ID: 00000001-0001-0001-0001-00000000010e Type: VdsGroups,  ID: a969df3a-f8f6-4128-96e1-4d28e6bf869f Type: VmTemplate
2014-05-01 18:25:10,669 INFO  [org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand] (org.ovirt.thread.pool-4-thread-50) [17e61d8f] Running command: AddVmAndAttachToPoolCommand internal: true. Entities affected :  ID: 00000001-0001-0001-0001-00000000010e Type: VdsGroups,  ID: a969df3a-f8f6-4128-96e1-4d28e6bf869f Type: VmTemplate,  ID: ea3ab93d-c3d5-444c-aa54-f044013fb60d Type: Storage
2014-05-01 18:25:10,680 INFO  [org.ovirt.engine.core.bll.AddVmCommand] (org.ovirt.thread.pool-4-thread-50) [7fd74749] Lock Acquired to object EngineLock [exclusiveLocks= key: rhel7_pool_c-1 value: VM_NAME
, sharedLocks= key: 43a2246a-6191-4c05-9103-8aa61ac94fa5 value: DISK
key: a969df3a-f8f6-4128-96e1-4d28e6bf869f value: TEMPLATE
]

there is no other AddVmTemplateCommand after this call.

I also tried to reproduce this locally and it worked for me.
Did i miss something?
if not, could you please retry and make sure you create the new version after you create the pool?

Comment 6 Omer Frenkel 2014-07-01 13:34:31 UTC
Closing as no response for a while,
in addition i did some tests and could not reproduce this.

please re-open if relevant