Rain Toolkit - Open Source Tools for Amazon EC2 Management

Sample Code & Libraries>Java>Rain Toolkit Open Source Tools for Amazon EC2 Management
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

Rain Toolkit is a set of command line tools that makes it easier to manage Amazon EC2 resources (virtual machines, volumes, snapshots etc.)


Submitted By: juliano155
AWS Products Used: Amazon EC2, Amazon SimpleDB
Language(s): Java
License: GNU General Public License (GPL version 2)
Source Control Access: http://kenai.com/projects/raintoolkit
Created On: March 15, 2010 1:09 PM GMT
Last Updated: August 16, 2010 5:35 PM GMT

Amazon already provides a set of command-line tools to manage EC2 resources. They allow stopping/starting instances, allocating ip addresses and volumes, attaching/detaching volumes etc.

However, when one starts using these tools to manage day-to-day operations it becomes clear that they have some limitations:

  • They are too fine grained, each tool dealing with a single EC2 object at a time. While this is great from a software design point of view, combining these tools to automate complex operations can be challenging.
  • The tools operate in an asynchronous way, reflecting the underlying EC2 platform workings. This makes scripting more complex as there is the need to poll in order to wait for an operation to complete.
  • They do not support friendly naming of EC2 resources, relying instead in EC2 object identifiers (like i-c4c026ac or vol-a5d83ecc) which are not intended to be human-readable.

RainToolkit solves all that by providing a set of command line tools based on the concept of virtual machine, a concept familiar to anyone who has used any traditional virtualization platform (VirtualBox, VMWare etc.).

RainToolkit commands allow you to manipulate virtual machines and its attachable components (volumes and elastic IP addresses) in a more sysadmin-friendly way by creating an inventory of Virtual Machine metadata that gets stored in Amazon Simple DB.

Using RaingToolkit

Creating a virtual machine in RainToolkit is as easy as:

create-virtual-machine -n myMachineName -i 

You can specify all the usual EC2 attributes in your virtual machines: availability zone, kernel, instance type (small, large, extra large etc.). You can also associate a virtual machine with an already running EC2 instance (labeling).

Starting a an EC2 virtual machine is as easy as:

start-virtual-machine -n myMachineName

Rain Toolkit will take care of launching the EC2 instance, waiting for it to start running ,attaching volumes to the right devices, attaching an elastic ip address etc.

You can also create EBS volumes or label existing EBS volumes:

create-volume -name myVolume -size 500 -z u-east-1c

Data for virtual machine and volume configuration is stored in Amazon Simple DB.

Viewing virtual machines, volumes and other objects is also equally easy:

Name                  Uptime        DnsName                                         InternalIpAddress     InstanceId
test-server           none          none                                            none                  none
website               200d00:21     ec2-174-129-201-163.compute-1.amazonaws.com        i-c4c026ac

All command line tools are designed to provide meaningful exit values (0 on success) so they can easily be used inside shell scripts.

Please check the tools documentation page for detailed installation and usage instructions.

©2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.