Bug 1305837

Summary: sign websocket proxy ticket via RESTapi when VM have VNC graphics protocol
Product: Red Hat Enterprise Virtualization Manager Reporter: Petr Kubica <pkubica>
Component: ovirt-engineAssignee: Tomas Jelinek <tjelinek>
Status: CLOSED CURRENTRELEASE QA Contact: meital avital <mavital>
Severity: high Docs Contact:
Priority: high    
Version: 3.6.3CC: eedri, gklein, lsurette, mgoldboi, michal.skrivanek, oourfali, rbalakri, Rhev-m-bugs, sbonazzo, srevivo, tjelinek, tnisan, ykaul
Target Milestone: ovirt-3.6.5Keywords: ZStream
Target Release: 3.6.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: It was not possible to get a signed websocket proxy ticket using REST API Consequence: Third party clients built on top of REST API were not able to connect to SPICE HTML5 nor to noVNC due to missing websocket proxy ticket Fix: Added support for signing the websocket proxy ticket using REST API Result: Now it is possible to build third party clients connecting to web consoles
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-25 14:30:28 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:

Description Petr Kubica 2016-02-09 11:30:01 UTC
Description of problem:
If I understand it correctly https://bugzilla.redhat.com/show_bug.cgi?id=1181030
sign websocket proxy ticket via RESTapi doesn't work with VNC as expected.

When I tried to sign the websocket proxy ticket via RESTapi when the VM have set VNC graphics protocol, api returned 500 Internal server error and thrown an exception to engine.log

2016-02-09 12:21:36,006 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-2) [] Operation Failed: 
2016-02-09 12:21:36,006 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-2) [] Exception: org.ovirt.engine.api.restapi.resource.BaseBackendResource$BackendFailureException: 
...

Version-Release number of selected component (if applicable):
rhevm-restapi-3.6.3-0.1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Have a VM with VNC graphics protocol UP
2. try to sign websocket proxy ticket via RESTapi
POST /vms/{vmid}/graphicsconsoles/{consoleid}/proxyticket
<action> <proxy_ticket> <value>ticket_content</value> </proxy_ticket> </action>
3. Check returned code and engine.log

Actual results:
500 Internal server error with exception in engine.log

Expected results:
Fail with right code without exception
Maybe with description message that VM have unsupported graphics protocol (or something else)

Additional info:
Attached engine.log

Comment 2 Tomas Jelinek 2016-02-11 10:00:34 UTC
It actually should work also for VNC (because of the noVNC). The problem is that the code does not handle the case when the tls_port is not set at all (which is the case for VNC).

Comment 3 meital avital 2016-04-11 08:32:34 UTC
Verified rhevm-3.6.5.1-0.1.el6

Verified  Steps:
1. Have a VM with VNC graphics protocol UP
2. try to sign websocket proxy ticket via RESTapi 
POST https://EngineIP/ovirt-engine/api/vms/aa011383-ece0-4a69-a5f1-63c3ec6234e5/graphicsconsoles/564e43/proxyticket

<action> <proxy_ticket> <value>ticket_content</value> </proxy_ticket> </action>

3. Check returned code -> Status Code: 200 OK

Comment 4 Eyal Edri 2016-04-25 14:30:28 UTC
3.6.5 released