Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow proxying WebMKS consoles using the WebsocketWorker #16490

Merged
merged 2 commits into from
Dec 5, 2017

Conversation

skateman
Copy link
Member

@skateman skateman commented Nov 17, 2017

The WebsocketWorker provides us a websocket-to-socket proxying that powers our browser based VNC/SPICE remote consoles. Thanks to this it's not necessary for the client to have a route to the hypervisor nor the VMs and the (internal) SSL certificate validation is also eliminated. Since VMware removed the support for VNC consoles since 6.5 and their only browser-based remote console technology is WebMKS, it also should be proxied.

As WebMKS runs on top of WebSocket, the worker needs to be rewritten to a websocket-to-* proxy. I introduced a new generic WebsocketRight class to ease the implementation of new protocol types on the right side of the proxy. All inherited classes should define a fetch(length) and an issue(data) methods for reading and writing on the right side of the proxy. The naming of these methods is intentional as the websocket-driver we're using reserves the write method.

Provider PR: ManageIQ/manageiq-providers-vmware#140
Classic UI PR: ManageIQ/manageiq-ui-classic#2768

https://bugzilla.redhat.com/show_bug.cgi?id=1504299

@martinpovolny
Copy link
Member

I have read all the 3 parts. Looks good to me. But I have NOT TESTED this.

@skateman
Copy link
Member Author

@martinpovolny I did 😉, and @simaishi promised me some custom appliances so @kedark3 can run his tests.

@bmclaughlin
Copy link
Contributor

@martinpovolny, @skateman: Tested on the Gaprindashvili appliance:
WebMKS connected, but was unusably slow
VNC connected (vSphere 6.0), roughly the same as before this PR
Spice connected (RHEV 4.0), roughly the same as before this PR

@bmclaughlin
Copy link
Contributor

@simaishi, the master appliance provided cannot run appliance_console (command not found). The Gaprindashvili appliance complains about specs, but runs fine. :)

@skateman
Copy link
Member Author

@kbrock would you have some time to take a look at this with me? I think the issue is somewhere here just don't know how else could I do this.

@simaishi
Copy link
Contributor

@simaishi, the master appliance provided cannot run appliance_console (command not found). The Gaprindashvili appliance complains about specs, but runs fine. :)

Fix for Gaprindashvili appliance spec complain - ManageIQ/manageiq-appliance-build#248

Will take a look at command not found for 'master'.

@simaishi
Copy link
Contributor

simaishi commented Dec 1, 2017

@skateman @bmclaughlin The 'master' appliance I built failed to run bundle install because of this:

Revision satoe-master does not exist in the repository https://github.com/skateman/manageiq-providers-vmware

If you change the branch to webmks-proxy in Gemfile and run bundle install, it should work ok.

@miq-bot
Copy link
Member

miq-bot commented Dec 4, 2017

Checked commits skateman/manageiq@0526e5f~...3edd55f with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
6 files checked, 1 offense detected

lib/websocket_proxy.rb

@skateman
Copy link
Member Author

skateman commented Dec 4, 2017

@bmclaughlin I think I solved performance problem, can you please retest? The set of changes is small so it's enough to do on a development setup.

@skateman skateman changed the title [WIP] Allow proxying WebMKS consoles using the WebsocketWorker Allow proxying WebMKS consoles using the WebsocketWorker Dec 4, 2017
@miq-bot miq-bot removed the wip label Dec 4, 2017
@bmclaughlin
Copy link
Contributor

@skateman, @martinpovolny this resolves the performance issue I experienced. 👍

@martinpovolny martinpovolny merged commit 6421e3d into ManageIQ:master Dec 5, 2017
@skateman skateman deleted the websocket-webmks branch December 5, 2017 14:08
@martinpovolny martinpovolny added this to the Sprint 75 Ending Dec 11, 2017 milestone Dec 5, 2017
simaishi pushed a commit that referenced this pull request Dec 5, 2017
Allow proxying WebMKS consoles using the WebsocketWorker
(cherry picked from commit 6421e3d)

https://bugzilla.redhat.com/show_bug.cgi?id=1520964
@simaishi
Copy link
Contributor

simaishi commented Dec 5, 2017

Gaprindashvili backport details:

$ git log -1
commit 59d2f840432a86900eed91c7f1594ac95a6c3c98
Author: Martin Povolny <[email protected]>
Date:   Tue Dec 5 15:07:56 2017 +0100

    Merge pull request #16490 from skateman/websocket-webmks
    
    Allow proxying WebMKS consoles using the WebsocketWorker
    (cherry picked from commit 6421e3ddf8512dc106119347e1dd36729de28f95)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1520964

simaishi pushed a commit that referenced this pull request Dec 8, 2017
Allow proxying WebMKS consoles using the WebsocketWorker
(cherry picked from commit 6421e3d)

https://bugzilla.redhat.com/show_bug.cgi?id=1523404
@simaishi
Copy link
Contributor

simaishi commented Dec 8, 2017

Fine backport details:

$ git log -1
commit c57f61036234db623fa7668095a3393121c104fb
Author: Martin Povolny <[email protected]>
Date:   Tue Dec 5 15:07:56 2017 +0100

    Merge pull request #16490 from skateman/websocket-webmks
    
    Allow proxying WebMKS consoles using the WebsocketWorker
    (cherry picked from commit 6421e3ddf8512dc106119347e1dd36729de28f95)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1523404

d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
Allow proxying WebMKS consoles using the WebsocketWorker
(cherry picked from commit 6421e3d)

https://bugzilla.redhat.com/show_bug.cgi?id=1523404
@ahmedcooll
Copy link

Hi Am trying the same using java code . Right now am using the following webmks which is provided by vmware but with proxy server , not able to reach the Host.
Is that possible to done it via java code . Please guide me .
wmks.connect(url);

Thanks in advance !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants