Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1095635 - Run once vm via REST with <pause>true</pause> parameter, save this parameter true also in next runs
Summary: Run once vm via REST with <pause>true</pause> parameter, save this parameter ...
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.4.0
Hardware: x86_64
OS: Linux
Target Milestone: ---
: 3.5.0
Assignee: Shahar Havivi
QA Contact: Artyom
Whiteboard: virt
Depends On:
Blocks: 1108676 rhev3.5beta 1156165
TreeView+ depends on / blocked
Reported: 2014-05-08 09:04 UTC by Artyom
Modified: 2015-02-17 08:26 UTC (History)
13 users (show)

Fixed In Version: ovirt-3.5.0-alpha2
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1108676 (view as bug list)
Last Closed: 2015-02-17 08:26:43 UTC
oVirt Team: ---
Target Upstream Version:

Attachments (Terms of Use)
engine and vdsm logs (deleted)
2014-05-08 09:04 UTC, Artyom
no flags Details

System ID Priority Status Summary Last Updated
oVirt gerrit 27518 master ABANDONED restapi: Always pass "pause" to backend Never
oVirt gerrit 27996 master MERGED core: do not save state VMs state on RunOnce Never
oVirt gerrit 28122 ovirt-engine-3.4 MERGED core: do not save state VMs state on RunOnce Never

Description Artyom 2014-05-08 09:04:08 UTC
Created attachment 893583 [details]
engine and vdsm logs

Description of problem:
When I run once vm via REST:
And after it I stop vm, in edit options I see that box "Start in Pause Mode" still checked, and if after it I run once vm with:
It start vm in pause mode, because box "Start in Pause Mode" checked.
And it impossible to unchecked this box via REST because <pause> parameter not exist under vm:
<vm href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0" id="4d508cfb-d109-4ac7-a15b-3acc1eeaeee0">
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/undo_snapshot" rel="undo_snapshot"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/commit_snapshot" rel="commit_snapshot"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/preview_snapshot" rel="preview_snapshot"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/cancelmigration" rel="cancelmigration"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/ticket" rel="ticket"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/move" rel="move"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/migrate" rel="migrate"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/reboot" rel="reboot"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/detach" rel="detach"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/export" rel="export"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/shutdown" rel="shutdown"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/start" rel="start"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/stop" rel="stop"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/suspend" rel="suspend"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/applications" rel="applications"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/disks" rel="disks"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/nics" rel="nics"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/cdroms" rel="cdroms"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/snapshots" rel="snapshots"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/tags" rel="tags"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/permissions" rel="permissions"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/statistics" rel="statistics"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/reporteddevices" rel="reporteddevices"/>
<link href= "/api/vms/4d508cfb-d109-4ac7-a15b-3acc1eeaeee0/watchdogs" rel="watchdogs"/>
<topology sockets="1" cores="1"/>
<os type="other">
<boot dev="hd"/>
<host href= "/api/hosts/3f7c5947-f3da-4634-8416-0548a284037f" id="3f7c5947-f3da-4634-8416-0548a284037f"/>
<cluster href= "/api/clusters/cb434140-f722-4d97-9cfb-dfe75dbd0afb" id="cb434140-f722-4d97-9cfb-dfe75dbd0afb"/>
<template href= "/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
<method id="GUEST_AGENT"/>
Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. See above

Actual results:
After that I stop Run once mode(with pause), box "Start in Pause Mode" still checked, also pause parameter not appear under vm

Expected results:
After that I stop Run once mode(with pause), box "Start in Pause Mode" unchecked
and pause parameter appear under vm.

Additional info:

Comment 1 Juan Hernández 2014-05-08 12:13:52 UTC
As far as I can tell it isn't possible to change the properties of the VM with the start operation, so I can only reproduce this if I manually change the "Start in Pause Mode" in the GUI.

The action that you are executing is "run", not "run once". In order to execute "run once" you need to pass a "vm" element, maybe empty:


From the point of view of the RESTAPI the presence of this "vm" element is what differentiates "run" and "run once". When using "run once" I see that the "pause" parameter is ignored, unless the value is "true". That is something to fix.

It is also true that the flag that specifies if the machine should by default be started paused isn't available via the RESTAPI. Please open another bug to add that.

Ori, can you please confirm/reject my comments?

Comment 2 Artyom 2014-05-08 14:12:58 UTC
Update: For reproduce behavior, you also need to attach floppy to vm in run once mode, so command in REST looks:
                <file id=floppy_image/>

Also the same thing happening in UI, if you run once vm with attached floppy and with enable flag "Start in paused mode", flag stay enabled under vm options also after stop vm.

Comment 3 Juan Hernández 2014-05-08 14:33:24 UTC
I verified that in my environment, if the pause parameter is true *and* a floppy is provided, then the "Start in paused mode" is automatically set in the database.

Comment 4 Juan Hernández 2014-05-08 14:46:06 UTC
The update of the "is_run_and_pause" database column is triggered in RunVmCommand.initVm(), it calls the VmStaticDAO.update() method when attaching a floppy:

  // if we attach floppy we don't need the sysprep
  if (!StringUtils.isEmpty(getParameters().getFloppyPath())) {

I'm not sure, but I think that the "run once" flow should never update the vm_static table. I'm moving the bug to the backend component and abandoning the proposed patch, as it is probably irrelevant.

Comment 6 Artyom 2014-06-18 13:02:05 UTC
Verified on ovirt-engine-3.5.0-0.0.master.20140605145557.git3ddd2de.el6.noarch

Comment 7 Omer Frenkel 2015-02-17 08:26:43 UTC
RHEV-M 3.5.0 has been released

Note You need to log in before you can comment on or make changes to this bug.