Skip to content


Subversion checkout URL

You can clone with
Download ZIP
RackSpace Cloud Server API demos
Python Shell PHP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



This is a couple of scripts that show up how the RackSpace Cloud Servers API works. It is by design keep simple to be easy to peek or to look at.


These demos needs the python-cloudservers library, unfortunately the upstream version from here :

Doesn't support different auth server, so the easiest way is to download my forked version :

and install it in your PYTHONPATH (usually /usr/local/lib/python${PYTHON_VERSION}/site-packages/ )


You would need to have a file config in the root directory of this software containing information about your Cloud containing :


export US_RCLOUD_USER="" export US_RCLOUD_KEY="" export US_RCLOUD_AURL=""

export UK_RCLOUD_USER="" export UK_RCLOUD_KEY="" export UK_RCLOUD_AURL=""

You don't have to have two different account but make sure RCLOUD_DATACENTER goes to the right ones.


The python directory has all the python scripts which is the guts to interact with cloudservers.

This is the description of what the script does :


    Allow you to choose a image to backup into RackSpace Cloud Files (by default on RackSpace UK Cloud).


    Will ask you to create a new image into the cloud and will launch a script on it with some basic configurations.


    Give you the opportunity to delete your stored images (or backups).


    Give you the opportunity to delete your stored servers.


    A simple script that output a nice generated random password (human readable).


    Will list your images available (not the system ones only yours).


    Will list your servers in your cloud.


Applications are different roles for showcasing the demos. As a start we have the guestbook application which create two servers a WEB and DB install a guestbook apps on it configure and secure it.

The purpose of this demo is to have it to setup a periodic task (cron) to backup the VM at certain time and automatically start it again at another time.

In the guestbook directory we have :


    Will create a web and a db server copy your SSH id_rsa key ~/.ssh/id_rsa for SSH access and launch the scripts and from your scripts directory. And configure neworking with the and


    Would backup those images in the cloud and deleting the server


    Would backup the images and adjust the networking on the server with the adjust-db or web networking scripts.


    This is the cron that takes care to check the files /tmp/guestbook-files-backup or /tmo/guestbook-files-restore for the time when the and needs to be started. You would need to configure your cron to launch it like this entry :

    */1 * * * * /home/russell/api-demo/guestbook/ backup &>/tmp/backup-log.txt */1 * * * * /home/russell/api-demo/guestbook/ restore &>/tmp/restore-log.txt


    Simple script that ask you for the time to backup and restore and dump the time in the /tmp/guestbook-file-{restore,backup}

Something went wrong with that request. Please try again.