About EC2

EC2 is Amazon's cloud service, based on a Xen dom0 compute environment. It uses a modified early early Xen environment. To do local testing the closest environment is CentOS 5.0.

Preparations

Getting Started

Signing up

You need an Amazon account in order to use Amazon EC2 etc. Go to Amazon web service page, and click on the sign up and follow through. They will want your credit card (yes your own personal CC for billing) and will require a valid phone number and email address. The phone number will be verified by calling you back (a robot calls you and asks for the 4 digit pin currently on your screen) or sending you a text message with a pin you must enter to complete your sign up.

Security Groups -- firewalling for your instances

Before you start your first instance you will need to set up your security domain. The default security does not allow your new instances to accept SSH connections. In the main web interface https://console.aws.amazon.com/ec2/home select Security Groups, then tick the tickbox next to the default group. This will display a new pane at the bottom of the window (often so small it just looks like a title), pull the separator bar up and you can see which ports are allowed. Select 'SSH' and 'TCP' in the bottom row and click Add. Now all new instances will use this new security domain and have SSH enabled.

How much will it Cost?

That varies based off of region, zone, instance size, number of instances, compute cycles used, time left running, amount of data transfered (and whether its between regions, zones or internet in general), and ebs storage used. Basically go read Amazons documentation.

It isn't "cheap", it will only cost a few cents to boot and play around with and image, but it can add up fairly fast. Basically the general rule of thumb is real hardware is cheaper as long as it is being utilized. Where EC2 is cheaper is it is flexible so that you can scale up as needed, which can be cheaper than purchasing and maintaining hardware for peak loads.

Basic Terminology

About AMIs

AMIs are like iso images that are booted to bring up a virtual machine in the cloud. They can be remixed to create new AMIs (several people take the base Ubuntu AMI and modify it).

There are two basic types of AMIs

About the EC2 kernels

Amazons services make use of both pv-ops and HVM + pv-on-hvm driver kernels. The HVM kernels are used by the Cluster Compute cloud while, pv-ops is used by the regular cloud.

There are two different types of Ubuntu paravirtualized kernels.

A Third kernel is needed for the compute cloud, this is based on a standard none paravirtualized kernel + the pv-on-HVM drivers.

Bootable kernel images

EC2 kernels if they are being registered as an AKI will not work if they are a bzimages. This is because the Hypervisor that is used to load the kernel does not support bzimage. A bootable image can be made from a standard kernel build by either

Once the gzipped kernel image is obtained it can be bundled and uploaded.

Note: the -EC2 topic branch kernels are built correctly to be registered as an AKI.

kernel images for use with in a pv-grub instance

If the kernel is to be used with an instance that has been setup for pv-grub (Maverick 10.10 and later) then a bzImage can be used, there is no stripping or bundling required, unless the kernel will be registered as an AKI.

Booting AMIs

When booting an AMI Xen Dom0 acts as the boot loader, so the kernel (AKI) and ramdisk (ARI) are specified separate from the actual operating system (AMI). Each AMI has a default AKI and ARI that is specified when the AMI is registered. An AMI can be booted with a different kernel by specifying the AKI and ARI to use at boot.

PV-Grub AMIs

Support for pv-grub images was added by Amazon during the Maverick development cycle and all Maverick and later kernels should support it. The default AKI, ARI for these images are provided by Amazon, which boots into a pv-grub environment which then looks at the AMI disk to find the real kernel.

It does this just like grub would it

In Maverick both instance store and ebs backed AMIs are setup to use pv-grub. Choosing an ebs image will allow persisting your instance, and upgrading kernels much like on a regular machine.

Testing Kernels

Using the Web interface

Using the AMI tools

Working with the EC2 topic branch

Getting the EC2 topic branch

Get a copy of the Ubuntu kernel git tree.

Checkout the ec2 branch

The branch will have a debian.ec2 directory which is used for building the kernel.

Building the EC2 kernel

The EC2 kernel is built using the same infrastructure as the standard Ubuntu kernel except the ec2 name is used.

Uploading a test kernel

Getting the Xen patchset

The ec2 topic branch is based on the xen patchset that SuSE is using. It is currently pulled directly from the SuSE kernel of the day.

Kernel Release Notes

Release specific information for Ubuntu EC2 kernels

Hardy

The hardy kernel is not maintained as described above. The EC2 kernel for Hardy is the Xen Dom0 kernel that is handled as a custom binary.

The Xen patchset for the Hardy kernel is obtained as described above for the topic branch EC2 kernels.

Intrepid

The intrepid kernel for EC2 is based on the Hardy kernel patch carried forward to intrepid.

Lucid

Does not require a ram disk to boot.

Maverick

Both instance store and ebs backed images use pv-grub to boot by default.

KernalTeam/EC2Kernel (last edited 2010-11-24 20:19:14 by p5B2E4052)