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

Bug 1434161

Summary: Video devices of templates are not updated correctly
Product: [oVirt] ovirt-engine Reporter: jniederm
Component: BLL.VirtAssignee: Martin Betak <mbetak>
Status: CLOSED CURRENTRELEASE QA Contact: meital avital <mavital>
Severity: high Docs Contact:
Priority: unspecified    
Version: futureCC: bugs, lveyde, mbetak, michal.skrivanek, sgratch, tjelinek
Target Milestone: ovirt-4.1.2Flags: tjelinek: ovirt-4.1?
tjelinek: planning_ack?
rule-engine: devel_ack+
rule-engine: testing_ack+
Target Release: 4.1.2   
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: 2017-05-23 08:14:54 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 jniederm 2017-03-20 20:53:34 UTC
Description of problem:
Updating of "Video Type" of templates doesn't update associated devices in DB.

Version-Release number of selected component (if applicable):
4.2 master, commit 1b0e382

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with (Console side tab) Video type: QXL and Graphics protocol: SPICE.
2. Create a template based on that VM
3. Update Video type of the template to "VGA" (graphics protocol is automatically updated to VNC).


Actual results:
Video device remains not updated. in `psql`:
=> select type, device from vm_device where vm_id = 'replace_by_template_id' AND type IN ('video', 'graphics');
   type   | device 
----------+--------
 graphics | vnc
 video    | qxl

Note: template id is on "General" subtab

Expected results:
video device in db matches the settings in the edit template dialog.

Additional info:

Comment 1 jniederm 2017-03-20 20:56:20 UTC
Is there any way how to verify that devices are not updated from Webadmin? I tried to create a new VM and the VM has devices vga+vnc - i.e. correct one.

Comment 2 Tomas Jelinek 2017-03-21 08:36:45 UTC
Jakub, maybe checking the "devices" subtab of the VM can help.

Comment 3 jniederm 2017-03-21 14:19:08 UTC
Unfortunately it would be helpful to check devices of a template and there is no "devices" subtab for templates.

Comment 4 Martin Betak 2017-03-22 15:37:15 UTC
@Jakub: not to my knowledge. Actually I don't think the user is even able to observe this database inconsistency other than looking into postgres itself.

Comment 5 Sharon Gratch 2017-03-26 11:52:06 UTC
You can always check the VM "General" subtab and see that the "Video Type" was displayed with updated value as required even before this fix. Actually everything works with the new video device value, although it wasn't changed in devices db table. 
The reason for that is that there is a data duplication and the video type is also saved under the vm_static.default_display_type and most of template actions are based on that value rather then the devices db video entry. 
This data duplication should be solved in future versions...

Comment 6 meital avital 2017-05-18 12:36:40 UTC
Verified on version: 4.1.2.2-0.1.el7 

engine=# select type, device from vm_device where vm_id = 'f69e7191-4ee6-4e98-8eed-7c218baf7741' AND type IN ('video', 'graphics');
   type   | device
----------+--------
 video    | vga
 graphics | vnc