VNC Console Cleanup

* DRAFT * This document outlines a plan for consolidating nova's vnc console code and apis.  At the moment, there are two partial and inconsistent implementations for instance vnc console access, each of which is hypervisor specific.  For essex, the goal is to create a consistent, hypervisor-independent way for users to access vnc consoles. To enable a variety of use cases, we aim to support two types of clients:

In each case, the design must enable the wire protocol between client and proxy to be the same regardless of hypervisor.

The State of the Current System

For libvirt, vnc consoles are supported only through a websocket proxy.  It uses a simple expiring token based auth system.  The present proxy, based on eventlet, has poor browser support.

For xen, vnc consoles are supported through a console system that backends to XVP (Xenserver VNC Proxy).  The system manages access to consoles by manipulating the configuration of an xvp conf file.  Additionally, this system uses db storage to manage consoles, pools, and other concepts found in xvp.  The underlying api/manager/driver mechanic, however, is generic, but possibly a bit more than we need since the required functionality could also be added to the compute api/manager/driver (generally, the compute driver is required to retrieve all the info we need to set up a vnc connection).

The XVP Auth Protocol

XS uses a simple auth protocol to control access to its consoles, which I'll refer to as the XVP auth protocol. The XVP auth protocol is essentially a normal vnc connection preceded with a quick http handshake.  The handshake works like this:

For XS, the credentials string requires 2 components:

Both of these pieces of information can be retrieved by accessing the XenAPI python library and stored on nova's backend to facilitate client connections. Note that any xen sessions that are set-up for vnc consoles will have to be cleaned up.

The Proposal Part I: Java client parity using XVP Auth

Since the XVP auth protocol is simple, it is easy to make a python server that can interpret an HTTP CONNECT to authenticate and create a vnc proxy.  For essex, the proposal is to use the XVP protocol as a standard auth mechanism for java client vnc authentication (for both libvirt and xs).

Client Compatibility

The client for this is assumed to be based off of Citrix's java vnc client, though a variant of TightVNC should be similarly easy to implement.

Supporting Services

vncproxy

The role of the vncproxy is threefold:

Each protocol implementation will use its own proxy, and for Essex the following two are planned:

There can be many proxy services running simultaneously as a cluster. To enable this, the functions of token validation and management will be separated into its own service(nova-consoleauth).

nova-consoleauth

This is a nova manager that stores token and connection information for console sessions. Like other managers, it communicates to interested services over the nova message bus. It's internal api consists of the following calls:

NOTE: connection_details are said to be 'expired' when now - created_at > TOKEN_LIFE.

NOTE: connection_details are said to be 'idle' when now - updated_at > IDLE_TIMEOUT.

vncproxy servers will will not honor expired tokens, which means that there is a narrow window of time for users to use access_urls. Once a proxy connection is established, vncproxy will call touch_connection_details for active connections once every X seconds or so. Specific drivers may determine how to handle idle connections. XS, for example, will need to actively close idle sessions before deletion.

Connection Process A: Retrieving a client connection url from the api

Story: Bob wants to access an instance vnc console, so he uses novaclient to authenticate with nova and retrieve a connection url.

Details:

NOTE: the OS api call to request a console will be a servers action: server.get_console(console_type), where console_type is one of ["xvp-vnc", "ws-vnc"]

Connection Process B: Citrix java client connects to nova

Story:  Bob then executes the Citrix java client using the url he just retrieved as a parameter. He now is able to log-in to his server.

Details:

The Proposal Part II: novnc parity

The underlying mechanics of setting up sessions for novnc are very similar to above.  Some things of note:

Other Stuff

Once this is in place, we should also get the Ajax console to use nova-consoleauth, and rework the associated api call so that it is similar in function to the other interactive consoles.

Console log would not be treated like an interactive console, and should have its own api.

Also note that atm there is very little useful debug traceback. The updated implementation should be done with debug-ability and audit-ability in mind.

Wiki: VNCConsoleCleanup (last edited 2011-12-15 22:55:39 by sleepsonthefloor)