Bug 1128453

Summary: [REST API]: VM next_run do not have all fields updated.
Product: [oVirt] ovirt-engine Reporter: Ilanit Stein <istein>
Component: RestAPIAssignee: Tomas Jelinek <tjelinek>
Status: CLOSED CURRENTRELEASE QA Contact: Israel Pinto <ipinto>
Severity: medium Docs Contact:
Priority: high    
Version: ---CC: bugs, gklein, mgoldboi, michal.skrivanek, rbalakri, sbonazzo, srevivo, ykaul
Target Milestone: ovirt-4.0.2Keywords: UserExperience
Target Release: 4.0.2.1Flags: rule-engine: ovirt-4.0.z+
ylavi: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: the next_run option was not working for graphics consoles nor for boot sequence Consequence: if there was a next run configuration available, it was not possible to find it out using the rest api Fix: added support for the ;next run for boot options and for the /graphicsconsoles subresource. Please note that the legacy <display> still does not support this option. Result: Now the user can determine both the next run configuration and the current configuration using the rest api.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-12 14:31: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:

Description Ilanit Stein 2014-08-10 14:18:48 UTC
Description of problem:
Read VM next_run, via REST, show 'console', and 'boot sequence' are not updated 
with the new values, set in VM via UI Edit running VM.   
They have the value of current VM configuration.

Version-Release number of selected component (if applicable):
ovirt-engine 3.5-rc1

How reproducible:
100%

Expected results:
VM current run should show all "NEXT BOOT" parameters.

Additional info:
The following parameters were tested as well, and their values were found CORRECT in the next_run:
memory, guaranteed memory, monitors, usb policy, cdrom change

Comment 1 Omer Frenkel 2014-08-25 11:23:31 UTC
the issue is that rest api has a feature to show 'dynamic' values (that contain the current run info) if it exists, so it overrides the next-run values.

Comment 2 Ilanit Stein 2015-10-27 12:36:30 UTC
Tested on rhevm 3.6.0-17.

Edit a running VM with these changes, that will apply only after next VM boot:
- console changed from spice to vnc
- boot sequence changed from first hard disk to network first, and then CD rom.

Run:
https://<engine ip>:443/ovirt-engine/api/vms/68cbc73b-5745-4890-aeeb-a5d66de65a44;next_run
  
Still the next_run output show the VM current_run, instead of next_run, as expected.

Comment 3 Red Hat Bugzilla Rules Engine 2015-10-27 12:36:37 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 5 Sandro Bonazzola 2015-11-05 08:22:16 UTC
oVirt 3.6.0 has been released on November 4th, re-targeting to 4.0 since this bug has been marked with severity < high

Comment 6 Red Hat Bugzilla Rules Engine 2015-11-16 14:07:32 UTC
This bug is flagged for 3.6, yet the milestone is for 4.0 version, therefore the milestone has been reset.
Please set the correct milestone or add the flag.

Comment 7 Sandro Bonazzola 2016-05-02 10:10:02 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 8 Yaniv Lavi 2016-05-23 13:25:47 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 9 Yaniv Lavi 2016-05-23 13:26:17 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 10 Tomas Jelinek 2016-07-18 08:11:35 UTC
Please note that the ;next_run still does not work for the legacy <display> and it will not be fixed since the <display> does not support the option to have more than one displays at once. To find the correct next_run configuration you need to check the /graphicsconsoles subresouce.

Comment 11 Israel Pinto 2016-08-02 11:45:05 UTC
Verify with:
Engine Version: 4.0.2.3-0.1.el7ev
Host: 
OS Version:RHEL - 7.2 - 9.el7_2.1
OS Description:Kernel Version:3.10.0 - 327.22.2.el7.x86_64
KVM Version:2.3.0 - 31.el7_2.16
LIBVIRT Version:libvirt-1.2.17-13.el7_2.5
VDSM Version:vdsm-4.18.5.1-1.el7ev
SPICE Version:0.12.4 - 15.el7_2.1

Steps:
1. Create VM and run it
2. Edit running VM with the following parameters:
   monitors, boot sequence, guaranteed memory,
   Migration: 'Do not allow migration'
   display (VNC/SPICE/VNC+SPICE)
3. Check the UI reports the next run updates
4. Check with REST API the next_nun configuration as expected    
   in https://<engine ip>:443/ovirt-engine/api/vms/<vm_id>;next_run
   and the flag is true:
   <next_run_configuration_exists>true</next_run_configuration_exists>

5. Display check compare current to next run:
  https://<engine ip>:443/ovirt-engine/api/vms/<vm_id>/graphicsconsoles;current
  https://<engine ip>:443/ovirt-engine/api/vms/<vm_id>/graphicsconsoles;next_run
6. Reboot VM and check that parameters updated

Results:

PASS