Scripting with the Phantom Autoscale API

Phantom uses the AWS Autoscaling protocol, and we boto for scripting Phantom. On this page we will describe some simple boto applications for interacting with Phantom.

Autoscale API

The first thing you will need in order to use the Autoscale API is your FutureGrid access tokens. Acquiring your FutureGrid access tokens is described here. Inside of your hotel.conf file you will find the access tokens under the entries:

vws.repository.s3id=<access key>
vws.repository.s3key=<secret key>

You will also need to know the URL of the Phantom Autoscale API service. It is:

For convenience store those values in the following environment variables:

export EC2_ACCESS_KEY=<access key>
export EC2_SECRET_KEY=<secret key>

Installing boto

We recommend using boto to interact with Phantom Autoscale API.


You must use boto 2.7.0 or greater, but not boto 2.9.3 which is incompatible with the Phantom Autoscale API.

To get started, create a new virtual environment and install boto into it. The following commands should do this for you:

$ virtualenv phantom
New python executable in phantom/bin/python
Installing distribute...............done.
Installing pip...............done.

$ source phantom/bin/activate

$ pip install 'boto >= 2.7.0, < 2.9.3'
Downloading/unpacking boto>=2.7.0,<2.9.3
  Downloading boto-2.9.2.tar.gz (875Kb): 875Kb downloaded
  Running egg_info for package boto


Successfully installed boto
Cleaning up...

You now have boto installed and ready to use. Please note the command:

$ source phantom/bin/activate

You will need to run this command in every session where you wish to use your python boto environment.

Sample scripts

The following sample programs can be used to aid in understanding. All of these values can be found in your FutureGrid cloud-client file.

Here is a sample session of using the above scripts. In it we will create a launch configuration that has 2 sites. We will then launch a domain that spans those 2 sites. First we create the launch configuration:

$ python testlc1@hotel hello-cloud
$ python testlc1@sierra hello-cloud
$ python

Note that we had to call twice, once for each cloud. We used the same name so that the two calls will be associated. In the listing they appear as two separate launch configurations, and as far as the AWS protocol goes they are treated as two launch configurations. However, in Phantom they will be treated as one.

The next thing we do is create a domain using that launch configuration:

$ python testDomain1 testlc1@hotel 3 hotel:1 sierra:2
using LaunchConfiguration:testlc1@hotel
$ python
    testlc1 : 3
        sierra : Healthy
        hotel : Healthy
        sierra : Healthy

The arguments to that program are as follows in order:

  • the new domain name
  • the launch configuration name
  • the size of the domain
  • a list of clouds and the maximum number of domains that will be on them. This takes the following format <cloud name>:<max vms>

Notice the we used the launch configuration name testlc1@hotel. We could have also used the name testlc1@sierra if we wanted to. It just has to match one of the AWS launch configuration names. Phantom will internally associate it with all the sites that have the name prefix of “testlc1”.

Now we clean everything up:

$ python testDomain1
deleting AutoScaleGroup<testDomain1>
$ python testlc1@hotel
$ python testlc1@sierra