Bug 1464819 - [API] Setting Custom Compatibility Version for a VM via REST api to a none/empty value is not working
[API] Setting Custom Compatibility Version for a VM via REST api to a none/em...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
4.1.2
x86_64 Linux
unspecified Severity medium
: ovirt-4.1.5
: ---
Assigned To: Sharon Gratch
Israel Pinto
: ZStream
: 1412725 (view as bug list)
Depends On: 1412725
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-25 20:55 EDT by Germano Veit Michel
Modified: 2017-10-26 02:10 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, setting the Custom Compatibility Version of a virtual machine to null with a REST API produced the following error: 2017-06-26 11:02:05,100+10 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-21) [] Operation Failed: [Cannot edit VM. Custom Compatibility Version is not supported: .] This update allows you to set the Custom Compatibility Version of a virtual machine to null with the following REST API request: POST /ovirt-engine/api/vms/<vm-id> ... <vm> <custom_compatibility_version/> </vm>
Story Points: ---
Clone Of: 1412725
Environment:
Last Closed: 2017-08-22 13:42:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 79223 master MERGED restapi: support setting empty CCV value for a VM via REST api 2017-07-11 10:52 EDT
oVirt gerrit 79603 ovirt-engine-4.1 MERGED restapi: support setting empty CCV value for a VM via REST api 2017-07-19 10:01 EDT

  None (edit)
Description Germano Veit Michel 2017-06-25 20:55:36 EDT
+++ This bug was initially created as a clone of Bug #1412725 +++

Description of problem:
Trying to set the Custom Compatibility Version of a VM to an empty value via REST api (in order to take the Custom Compatibility Version value of the Cluster) is not supported, 

This should be done by running the following:
POST /ovirt-engine/api/vms/<vmid>
<vm>
    <custom_compatibility_version/>
</vm>

but it fails with an error: 
<detail>
For correct usage, see: http://butterfly.usersys.redhat.com:8080/ovirt-engine/api/v4/model#services/vm-graphics-consoles/methods/add
</detail>
<reason>Request syntactically incorrect.</reason>

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

How reproducible:
100%

Steps to Reproduce:
1.Try to create a vm or edit a vm and set custom_compatibility_version attribute to an empty value:
<vm>
    <custom_comaptibility_version/>
</vm>

Actual results:
It failed with error:
<detail>
For correct usage, see: http://butterfly.usersys.redhat.com:8080/ovirt-engine/api/v4/model#services/vm-graphics-consoles/methods/add
</detail>
<reason>Request syntactically incorrect.</reason>

Expected results:
It should succeeded.
Comment 1 Germano Veit Michel 2017-06-25 21:16:27 EDT
In rhevm-4.1.2.2-0.1.el7.noarch:

vm_service.update(
    vm=types.Vm(
        custom_compatibility_version=types.Version()
    )
)

Results in:

DEBUG:root:PUT /ovirt-engine/api/vms/f03206ec-475b-4a66-9309-d85e454aa8d5 HTTP/1.1
DEBUG:root:Content-Length: 45
DEBUG:root:<vm>
DEBUG:root:  <custom_compatibility_version/>
DEBUG:root:</vm>
DEBUG:root:upload completely sent off: 45 out of 45 bytes
DEBUG:root:HTTP/1.1 400 Bad Request

2017-06-26 11:02:05,100+10 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-21) [] Operation Failed: [Cannot edit VM. Custom Compatibility Version is not supported: .]

And "custom_compatibility_version=None" results in:

DEBUG:root:<vm/>
DEBUG:root:upload completely sent off: 6 out of 6 bytes
DEBUG:root:HTTP/1.1 200 OK

Which obviously is accepted but doesn't work.

Also see:
BZ #1367411
https://gerrit.ovirt.org/#/c/69984/
Comment 3 Sharon Gratch 2017-07-31 05:48:36 EDT
*** Bug 1412725 has been marked as a duplicate of this bug. ***
Comment 5 Israel Pinto 2017-08-08 03:53:53 EDT
Verify with:
engine: 4.1.5.1-0.1.el7 

Steps:
1. Create VM
2. Set custom_compatibility_version from UI to 4.1
3. Update custom_compatibility_version to empty value from REST 
With:
<vm>
    <custom_compatibility_version/>
</vm>

Results: PASS
custom_compatibility_version updated to empty value.
Comment 7 errata-xmlrpc 2017-08-22 13:42:35 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:2509

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