3.5. Remotely Controlling VMs with Pilot

3.5.1. Pilot Overview

"Pilot" is a program that can be used on Windows, Mac OS X and Linux systems to remotely and securely control VMs that are housed on Rocks Clusters. Pilot communicates to the "Airboss" (see section The Airboss for more info) on a Rocks frontend. Pilot can power off, power on, install and connect to the console of VMs.

3.5.2. Installing Pilot

3.5.2.1. Installing Pilot on Mac OS X

Open a "terminal" session and execute:

$ curl -o pilot.py http://www.rocksclusters.org/ftp-site/pub/rocks/extra/pilot/pilot.py
$ chmod a+x pilot.py
$ curl -o TightVncViewer.jar http://www.rocksclusters.org/ftp-site/pub/rocks/extra/pilot/osx/TightVncViewer.jar
$ curl -o foundation-python-extras.dmg http://www.rocksclusters.org/ftp-site/pub/rocks/extra/pilot/osx/foundation-python-extras.dmg

Install the "foundation-python-extras.dmg" package:

$ open foundation-python-extras.dmg

This will open a window with a picture of an open box icon with the label "foundation-python-extras.pkg" under it. Double click on the open box icon.

This will open an installation window. Click on the default settings to properly install this package.

3.5.2.2. Installing Pilot on Windows

The following procedure has been tested on Windows 7, 32-bit.

First, you'll need to install "curl" on your machine. Download and unzip the following file:

http://am.net/lib/TOOLS/curl/curl-7.21.2-ssl-sspi-zlib-static-bin-w32.zip

Then, from the Rocks web site, download:

http://www.rocksclusters.org/ftp-site/pub/rocks/extra/pilot/windows/DLSupport.bat

Open a Windows Command Prompt and execute:

PATH=%PATH%;<directory for unzipped curl>
DLsupport

The above will download: Pilot, VCredist, Python v2.7, OpenSSL and M2Crypto.

Install VCredist, Python v2.7, OpenSSL and M2Crypto by executing:

vcredist_x86.exe
python-2.7.msi
Win32OpenSSL_Light-1_0_0a.exe
M2Crytpo-0.20.2.win32-py2.7.exe

If you don't already have an SSH client, you'll need to download one. We suggest Putty:

http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe

Most Windows PCs already have Java installed. Pilot has been tested with versions available from:

http://www.java.com/en/download/

3.5.3. Create a Public/Private Key Pair

Pilot uses a private/public key pair to authenticate its messages with the Airboss. If you haven't already created a key pair and associated the public key with the virtual frontend of the cluster you wish to remotely control, then login to the physical frontend that houses your virtual cluster and execute the procedure found here: Creating an RSA Key Pair.

Then copy the private key to the same directory on your machine where you have installed "pilot.py".

3.5.4. Open an SSH Tunnel from Your Machine to the Physical Frontend

Pilot sends messages to the Airboss on port 8677. We'll need to open a secure tunnel and forward port 8677 from your local machine to the Rocks frontend where the Airboss is running.

3.5.4.1. Mac OS X SSH Tunneling

Open a new terminal session and execute:

$ ssh -L 8677:localhost:8677 root@beopen.rocksclusters.org

Be sure to replace "beopen.rocksclusters.org" with the FQDN of your frontend.

3.5.4.2. Windows SSH Tunneling

If using PUTTY, a guide to setting up tunnels can be found here:

http://docs.cs.byu.edu/general/ssh_tunnels.html#use-putty-to-set-up-a-tunnel

3.5.5. Using Pilot for Remote VM Power Control

Before you get started, open a new terminal session on your machine. Pilot is a command-line utility.

To power on a VM, you must know the MAC address of the VM you wish to power on. Assuming you want to power on the VM named "frontend-0-0-0" on your physical frontend, execute:

# rocks list host interface frontend-0-0-0
SUBNET  IFACE MAC               IP              NETMASK       MODULE NAME                  VLAN OPTIONS CHANNEL
private eth0  76:77:6e:40:00:00 10.1.255.251    255.255.0.0   ------ frontend-0-0-0        2    ------- -------
public  eth1  76:77:6e:40:00:01 137.110.119.118 255.255.255.0 ------ frontend-0-0-0-public 0    ------- -------

The VM frontend-0-0-0 has the MAC addresses of 76:77:6e:40:00:00 and 76:77:6e:40:00:01. You can use either with pilot.

To power on frontend-0-0-0, execute:

$ ./pilot.py set host power host=76:77:6e:40:00:00 key=private.key action=on

To power off frontend-0-0-0, execute:

$ ./pilot.py set host power host=76:77:6e:40:00:00 key=private.key action=off

To power on and to force frontend-0-0-0 to install, execute:

$ ./pilot.py set host power host=76:77:6e:40:00:00 key=private.key action=install

3.5.6. Using Pilot to Connect to a VM's Console

You can also connect to a VMs console with pilot by executing:

$ ./pilot.py open host console host=76:77:6e:40:00:00 key=private.key

Warning

When you connect to a VM's console, you will see two mouse pointers, that is, the mouse pointers are not in "sync". You will have to experiment to find which pointer is the true pointer for the console.