Bug 1429516

Summary: Different result for UI and REST API action on updating VM with headless resource.
Product: [oVirt] ovirt-engine Reporter: Vitalii Yerys <vyerys>
Component: BLL.VirtAssignee: Sharon Gratch <sgratch>
Status: CLOSED DUPLICATE QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.1CC: bugs, tjelinek, vyerys
Target Milestone: ovirt-4.1.3Flags: tjelinek: ovirt-4.1?
tjelinek: planning_ack?
tjelinek: devel_ack?
tjelinek: testing_ack?
Target Release: ---   
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-03-07 12:31:55 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 Vitalii Yerys 2017-03-06 14:13:01 UTC
Description of problem:
When the VM is updated with a headless instance_type (no graphic consoles) VM becomes headless (which is okay), but when the same action is performed via REST VM is not transferred to the headless state, and has all of the displays set. The suspicion is that this one is related to BZ1429471.


Version-Release number of selected component (if applicable):
master

Engine: Red Hat Virtualization Manager Version: 4.1.1-0.1.el7


How reproducible:
100%


Steps to Reproduce:
1. Create a VM.
2. Create a headless instance_type.
3. Update the VM with previously created headless instance type
4. Verify VM becomes headless.
5. Restore VM to setup state (not headless/using some default instance_type)
6. Get the headless instance_type via REST API.
../ovirt-engine/api/instancetypes/<instance_type-id>

7. Update VM to use headless instance_type via Rest by using following call:
PUT ../ovirt-engine/api/vms/<vm-id>

Body:
<vm>
    <response body achieved in step #6>
</vm>

Example of body:
http://pastebin.test.redhat.com/461694


Actual results:
VM is not transferred to headless mode after updating it with headless instance_type via REST API.


Expected results:
The behavior for UI usage and REST API should be the same, and VM should become headless when updating it with headless instance_type.


Additional info:

Comment 1 Sharon Gratch 2017-03-07 11:09:02 UTC
This wasn't meant to be supported for 4.1
The only support we have in REST api for Ovirt 4.1 regarding headless VM/template/instance-type is by using the /graphiccosnoles api for updating an existing such entity to become headless/non-headless.

We still don't support headless by using apis like: 
PUT ../ovirt-engine/api/vms/<vm-id> or 
PUT ../ovirt-engine/api/instancetype/<instance_type-id>

I guess it will be handled as part of BZ1406394 for 4.2

Comment 2 Tomas Jelinek 2017-03-07 12:31:55 UTC
indeed, so lets track it on one place only

*** This bug has been marked as a duplicate of bug 1406394 ***