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

Bug 1408691

Summary: Number of monitors is not updated after reboot
Product: [oVirt] ovirt-engine Reporter: Israel Pinto <ipinto>
Component: BLL.VirtAssignee: Sharon Gratch <sgratch>
Status: CLOSED CURRENTRELEASE QA Contact: Israel Pinto <ipinto>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, ipinto, smelamud, tjelinek
Target Milestone: ovirt-4.1.0-rcKeywords: AutomationBlocker
Target Release: 4.1.0.2Flags: rule-engine: ovirt-4.1+
rule-engine: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+
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-02-01 14:59:25 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:
Attachments:
Description Flags
engine.log
none
icon_after_update
none
daillog_box_with_next_run_change none

Description Israel Pinto 2016-12-26 12:22:46 UTC
Created attachment 1235388 [details]
engine.log

Description of problem:
Update the number of monitors from 1 to 2, and reboot VM.
The number of monitors is not updated. 


Version-Release number of selected component (if applicable):
Engine: 4.1.0-0.3.beta2.el7
Host:
OS Version:RHEL - 7.3 - 7.el7
Kernel Version:3.10.0 - 514.2.2.el7.x86_64
KVM Version:2.6.0 - 28.el7_3.2.ram.dbg.v4
LIBVIRT Version:libvirt-2.0.0-10.el7_3.2
VDSM Version:vdsm-4.19.1-1.el7ev
SPICE Version:0.12.4 - 19.el7


Steps to Reproduce:
1. Create VM and run it
2. Update number of monitors (under console tab) Or via REST, from 1 to 2.
3. Reboot VM
4. Check number of monitors via: REST and GUI 

Actual results:
Number of monitors did not updated  stay 1

Expected results:
number of monitor = 2


Additional info:
No errors in the engine/vdsm log

Comment 1 Michal Skrivanek 2016-12-27 07:27:22 UTC
How did you reboot the VM?
What about the pending changes icon?

Comment 2 Israel Pinto 2016-12-27 07:45:08 UTC
1. The icon and the dialog(updating about numOfMonitors) are shown.
2. One time shotdown VM and start the VM, one time reboot with "Reboot" button
both case the number of monitor did not update

Comment 3 Michal Skrivanek 2016-12-27 14:38:03 UTC
So the the pending changes icon(that little triangle with exclamation mark) is shown? Even after shutdown? That sounds unlikely
Reboot may not necessarily bring the guest down, but then the icon stays. Whereas shutdown applies the changes and no pending changes icon is shown on next start
So you're saying in both cases the icon is there and in both cases the change is not applied?

Comment 4 Israel Pinto 2016-12-27 14:45:21 UTC
1. About the icon is shown after the update only. After the reboot of the VM the icon is gone.
2. Both cases vm is not updated with number of monitors.
Note: if you check the next run via REST the Monitors is not updated.

Comment 5 Michal Skrivanek 2016-12-27 14:49:00 UTC
Ok, then please attach a screenshot of what icon do you mean. 
Also a screenshot of the VMs view after the changes are applied (to see id there is the pending changes icon)

Comment 6 Israel Pinto 2016-12-27 14:59:30 UTC
Created attachment 1235526 [details]
icon_after_update

Comment 7 Israel Pinto 2016-12-27 15:00:37 UTC
Created attachment 1235528 [details]
daillog_box_with_next_run_change

Comment 8 Michal Skrivanek 2016-12-27 16:16:33 UTC
Why do we try to update unrelated fields(again)?

Comment 9 Shmuel Melamud 2016-12-28 11:54:08 UTC
(In reply to Michal Skrivanek from comment #8)
> Why do we try to update unrelated fields(again)?

Where do you see unrelated fields here? Number of monitors was changed and numOfMonitors is the only field that is listed under "Changes that require Virtual Machine restart" (see screenshot in comment 7).

Comment 10 Tomas Jelinek 2017-01-03 15:21:42 UTC
This is a regression introduced by https://gerrit.ovirt.org/#/c/67576/
The issue is that the VmDeviceUtils.getVmDevicesForNextRun() removes the video device from the vmManagedDeviceMap.
This map is later used in OvfWriter.writeMonitors() which expects the video device to be there and stores other things like VirtualQuantity (e.g. the num of monitors) or the SinglePciQxl into it.

@Sharon, can we remove the code from VmDeviceUtils.getVmDevicesForNextRun() deleting the video device?

Comment 11 Israel Pinto 2017-01-23 15:32:38 UTC
Verify with:
Engine Version: 4.1.0.3-0.0.master.20170122091652.gitc6fc2c2.el7.centos
Host:
OS Version:RHEL - 7.3 - 7.el7
Kernel Version:3.10.0 - 514.6.1.el7.x86_64
KVM Version:2.6.0 - 28.el7_3.3.1
LIBVIRT Version:libvirt-2.0.0-10.el7_3.4
VDSM Version:vdsm-4.19.2-1.gitd9c3ccb.el7.centos
SPICE Version:0.12.4 - 20.el7_3

Steps:
1. Create VM and run it
2. Update number of monitors (under console tab) Or via REST, from 1 to 2.
3. Reboot VM
4. Check number of monitors via: REST and GUI 

Results:
Number of monitors = 2