Bug 1318261

Summary: Python-SDK: add support for URL parameters in updates
Product: Red Hat Enterprise Virtualization Manager Reporter: Juan Hernández <juan.hernandez>
Component: ovirt-engine-sdk-pythonAssignee: Ondra Machacek <omachace>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.3CC: juan.hernandez, lsurette, mgoldboi, michal.skrivanek, mperina, oourfali, pstehlik, rbalakri, Rhev-m-bugs, rhodain, srevivo, ykaul
Target Milestone: ovirt-4.0.5Keywords: ZStream
Target Release: 4.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-ovirt-engine-sdk4-4.0.2-1.el7ev Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1318212 Environment:
Last Closed: 2017-06-24 05:47:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1318212    
Bug Blocks:    

Description Juan Hernández 2016-03-16 11:32:31 UTC
+++ This bug was initially created as a clone of Bug #1318212 +++

Description of problem:
When increasing VM memory via rhevm-shell. The default behaviour is to hot-plug the memory. This does not have to be possible due to the compatibility version for instance.

Version-Release number of selected component (if applicable):
rhevm-cli-3.6.2.0-1.el6ev

How reproducible:
100%

Steps to Reproduce:
1. Start a VM on a cluster with 3.5 compatibility version.
2. Try to updte the memory: update vm ${VM_NAME} --memort ${MEMORY_SIZE}

Actual results:
The memory is not updated and engine reports an error in the engine.log

Expected results:
Add possibility to set the memory for next run.

Additional info:
This is a regression as this was possible in RHEV 3.5

A possible way to achieve is via curl:

curl -X PUT -H "Accept: application/xml" -H "Content-Type: application/xml" -u admin@internal:password --cacert /etc/pki/ovirt-engine/ca.pem -T data.xml 'https://rhevm36/ovirt-engine/api/vms/a774093d-fb09-4fb7-aff3-989d7c3755c1;next_run'

--- Additional comment from Juan Hernández on 2016-03-16 07:30:24 EDT ---

There are two reasons why this doesn't work. First is that the "next_run" parameter isn't documented in the metadata of the API, thus from the point of view of the generators of the SDKs it doesn't exist.

The second reason is that currently the Python SDK doesn't support URL parameters in "update" operations. The CLI obtains the description of the API inspecting the Python SDK. Thus, from the point of view of the CLI, the "next_run" parameter won't exist even if it is added to the metadata of the API. To support it the generator of the SDK will need to be improved to support URL parameters (similar to bug 1311495), then the SDK will need to be regenerated.

I'm moving the bug to the ovirt-engine component, so that we can add "next_run" to the documentation. Then I will clone this bug for the Python SDK.

Comment 1 Yaniv Lavi 2016-05-09 11:01:07 UTC
oVirt 4.0 Alpha has been released, moving to oVirt 4.0 Beta target.

Comment 5 Ondra Machacek 2016-10-04 12:29:05 UTC
Bug #1318212 was fixed for API version 4 only. So targeting this to Python SDK v4.

It's possible to send URL parameter as follows:

 vms_service = connection.system_service().vms_service()
 vm = vms_service.list(search='name=myvm')[0]
 vm_service = vms_service.vm_service(vm.id).get(next_run=True)

Comment 6 Lukas Svaty 2016-10-13 10:24:02 UTC
verified in 

enum34==1.1.6
ovirt-engine-sdk-python==4.0.2
pycurl==7.43.0
six==1.10.0