vmrc-wrapper
------------
This is a wrapper around the vmware-vmrc executable that is installed with the Firefox remote console plugin. It connects to a vCloud instance with the vCloud API to obtain a "screen ticket" to open a remote console session, and sends it along as command-line parameters to vmware-vmrc.

Screen Tickets
--------------
A screen ticket looks like this:
mks://<IP>/vm-816?ticket=TE-pFSxHMFxHLMWHBnKjnMXJ3kx1Rel...
and consists of:
    VCD IP: <IP>
        used for proxying remote console connections
    MOID: vm-816
        the unique VM identifier
    Ticket: TE-pFSxHMFxHLMWHBnKjnMXJ3kx1Rel
        a ticket string, valid for 30sec (according to the vmware docs)

What's Here
-----------
newvcloud.py
    A modified driver for the vCloud API
get-console.py
    * Obtains the API endpoints of VMs from vCloud
    * Caches the API endpoints
    * Looks up endpoint in cache based on desired VM name
    * Obtains screen ticket from vCloud API using endpoint
    * Runs vmware-vmrc
userpass.py
    Configuration file; contains the location of vmware-vmrc

Installation
------------
0) Requires python, xwindows, ssh, vmware-vmrc plugin install
1) install setuptools:
    apt-get install python-setuptools
2a) If this works, install unmodified libcloud:
    easy_install apache-libcloud
2b) otherwise, if going through a proxy, easy_install won't play nicely.
    wget http://ftp.wayne.edu/apache/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2
    easy_install -f <path to archive parent dir> apache-libcloud
3) in userpass.py, set:
 - the IP of your vCloud Director instance and 
 - the vmware-vmrc path to whatever it is on the machine
4) run get-console.py (see below)

Sample Usage
------------
ssh -XY remote1@<IP> /home/remote1/cloud/get-console.py <VMName> <user>@<org> <password>

where <IP> is the machine where this installation resides,
<VMName> is the name of the VM to connect to,
<user> is the vCloud Director username,
<org> is its organization, and
<password> is its password

see a sample screenshot in get-console-demo.png (sans password)

License
-------
Copyright (c) 2011, Carnegie Mellon University.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.