Personal tools
     DOCUMENTATION

rBuilder Online:Amazon Elastic Compute Cloud

From rPath Wiki

Jump to: navigation, search
rBuilder Online--> Builds--> Build Types--> Amazon Machine Image--> Amazon Elastic Compute Cloud

Contents

rBuilder provides direct preparation of an appliance image for the Amazon Elastic Compute Cloud (EC2), part of Amazon Web Services™. Select the rBuilder Online build type to create an Amazon Machine Image (AMI) from an appliance group cooked with the Xen DomU flavor. An AMI includes all the necessary components to set up and boot an Amazon EC2 instance. See the Amazon EC2 main page for a description of AMIs and how EC2 makes use of Amazon S3 storage for your images.

To use an AMI on EC2:

  1. Start an AMI instance.
  2. Access the running AMI.
  3. Reboot or stop an AMI instance.

For the first time only, you will need to:

Set Up an Account for EC2

To create a new Amazon.com account, or to add Amazon Web Services to an existing Amazon.com account, visit the Amazon Web Services site and click Create an Account from the Learn About Amazon Web Services menu on the left side of the page. The account is free and used to manage your purchased web services.

Add EC2 to your web services account by clicking Sign Up For Web Service on the right side of the Amazon EC2 page.

Image:Bulbgraph.png   This service is currently in limited beta. If you are not part of the beta, check back periodically for updates from Amazon Web Services.

Obtain the Access Key ID values associated with your account and used for web service requests from client software. Click Your Web Services Account --> AWS Access Identifiers from the upper left of the Amazon Web Services page. Provide your Amazon.com password when prompted, and locate the key values in the Your Access Key ID and Your Secret Access Key sections of the screen.

Amazon Web Services provides a Getting Started Guide at its Resource Center. Select Amazon Elastic Computing Cloud from the Resource Center menu, and then search for "Getting Started Guide" to locate the latest version. (HTML version of the 2007-01-03 guide)

Set Up EC2 Utilities

Access and use an AMI by setting up one of the following EC2 client utilities for managing AMIs:

EC2 Command Line Tools

To use the EC2 Command Line Tools, download the tools from Amazon.com and install them on your local system.

Use the Setting up the Tools section of the Getting Started Guide to:
  • Instruct the system where to locate the tools.
  • Add the tools to the system path.
  • Set the EC2_PRIVATE_KEY and EC2_CERT environment variables used to authenticate with EC2; these values correspond to the Access Key ID and X.509 Certificate values on the AWS Access Identifiers page.
Amazon EC2 Firefox Extension

If you are using Mozilla Firefox as your browser, use the following steps to set up the Amazon EC2 Firefox Extension to browse your AMIs:
  1. Download and install the extension: XPI link
  2. Restart Firefox as prompted after the install.
  3. Click Tools --> EC2 UI to open the EC2 Firefox UI.
  4. Click Credentials at the top to add your Amazon Web Services account:
    1. Type your account and the Access Key values from your AWS Access Identifiers page.
    2. Click Add and verify the account access key values were added.
    3. Click Close.

Add multiple credentials to access multiple Amazon Web Services accounts.

Start the AMI

rBuilder automatically uploads a new EC2 image to Amazon S3, and it provides the AMI ID for the image on the rBuilder release page. The AMI ID will look similar to ami-5bae4b32. To use this AMI ID and boot your AMI, use the appropriate EC2 commands or EC2 Firefox extension instructions.

EC2 Command Line Tools

Use the AMI ID provided by rBuilder to launch an instance of the AMI:
> ec2-run-instances <ami_id>
Amazon EC2 Firefox Extension

Use the following steps to add the AMI ID and boot the AMI:
  1. Navigate to the AMIs and Instances tab.
  2. In the Available AMIs list, select the AMI ID reported by rBuilder.
  3. Click the green power button above the Available AMIs list.
  4. Verify the AMI shows in the Your Instances list and includes a DNS name you can use to access it.

Access the AMI

A running AMI is available by its DNS hostname and controlled by the security groups for your AMIs. The default security group provides access to typical TCP-IP ports, and other ports can be authorized if necessary using EC2 commands or the Security Groups tab in the Firefox extension.

Find the DNS hostname of the AMI instance you want to access:

EC2 Command Line Tools

Note the instance ID reported when the instance was launched, and use that in the following command:
> ec2-describe-instances <instance_id>
Use the DNS value of the instance reported by this command.
Amazon EC2 Firefox Extension

Note the DNS hostname displayed in the Your Instances list.

Remote Administration

If your appliance includes the rPath Appliance Platform Agent (rAPA), use the rAPA web interface to step through some initial appliance setup and conduct continued remote appliance administration tasks. Access rAPA by https on port 8003:

https://<hostname>:8003

Use port 8004 for non-SSL access to provide a demo that does not prompt about self-signed certificates.

Command Line Access

For secure shell (ssh) access to the appliance from your local system, generate a key pair and authorize port 22 prior to launching the AMI instance:

EC2 Command Line Tools

Generate the key pair with a unique key pair name:
> ec2-add-keypair <key_pair_name>
Copy the output lines starting with the "begin" line and ending with the "end" line to a private key file; this is the private key file. Use the key pair name in the -k option when launching the AMI instance:
> ec2-run-instances <ami_id> -k <key_pair_name>
Authorize port 22 on all running instances to enable ssh:
> ec2-authorize default -p 22
Amazon EC2 Firefox Extension

Access the Key Pairs tab and click the green key button to create a new key pair. Choose a key pair name and use the file save dialog box to select a location and file name for the private key.

Select the new key pair name from the KeyPair drop-down list when launching a new AMI instance.

Use the private key file with the -i option for ssh:

> ssh -i <private_key_file> root@<hostname>

Reboot or Stop the AMI

Reboot the AMI instance to preserve changes and continue using the AMI.

EC2 Command Line Tools

Reboot an EC2 instance using the instance ID:
> ec2-reboot-instances <instance_id>
Amazon EC2 Firefox Extension

Select a running instance and click the red sunburst button to reboot the selected instance. A right-click menu for the instance also includes Reboot this instance.

Stop (terminate) the AMI instance to ensure the hourly charged for EC2 service is not incurred when the instance is no longer in use. However, note that any changes made to the AMI are not saved between instance launches, so all changes will be lost after the instance is terminated.

EC2 Command Line Tools

Terminate an EC2 instance using the instance ID:
> ec2-terminate-instances <instance_id>
Amazon EC2 Firefox Extension

Select a running instance and click the red stop button to terminate the selected instance. A right-click menu for the instance also includes Terminate this instance.