On the EC2, I used the Rightscale ami as the V1 version of Centos5, which has a kernel version of 2.6.16.
You can upgrade to 2.6.18 using the following methods.
Because Amazon allows you to select the kernel version at startup, Amazon offers the latest kernel version of 2.6.18 (in fact, Rightscale is using Amazon's 2.6.18 kernel), so you can choose to use 2.6.18 kernel to start and then repackage instance into an AMI. There are official documents below.
Note: After using 2.6.18kernel, after starting, to view the output, there are the following error
Solutions:
Untar the file and you'll get NonBlank folders Boot and lib. Copy the files under boot to/boot of your AMI. And similarly MV the contents of Lib/modules To/lib/modules of the instance. When launching your Ami, mention the kernel ID too--the one of the link is aki-9b00e5f2.
Use AKI-9B00E5F2 (32-bit) to start the AMI, then upload module to the appropriate directory, and then repackage it into an AMI.
The module download address is described in the official documentation below.
Http://developer.amazonwebservices.com/connect/entry!default.jspa? Categoryid=112&externalid=1345&fromsearchpage=true
If you're looking for a version of kernel, you can search the Amazon Ami
Feature Guide:amazon EC2 User selectable kernels
This guide introduces the User selectable kernels for Amazon EC2.
AWS Products Used:amazon Ec2language (s): Otherdate published:2008-03-27
Introduction
Amazon EC2 now allows developers to use kernels other than the "default Amazon EC2 kernels with misspelling instances.
An Amazon Kernel image (AKI) are errors to a Amazon Machine image (AMI). The latter is prefixed with "ami-" while the former are prefixed with "aki-". In addition, Amazon EC2 supports Amazon RAM disk Images (ARI) abound might is required by kernels and are with "prefixed".
As of this release, anyone can-alternative kernels or RAM workloads with misspelling AMIs, but the ability to create and publish kernels a nd ramdisks is restricted to Amazon EC2 and selected vendors.
Prerequisites
Unreported you begin, make throaty your are using the right versions of our WSDL, API Tools, and APIs:
WSDL and API version:2008-02-01 or later API tools:1.3-19403 2008-02-01
Note:you can check version information using the Ec2ver command.
Finding Available Kernel Images (Akis) and RAM workloads (ARIs)
We'll use the Getting started image, and launch it with a alternative public kernel. Finding the AMI ID for this image was described in the Amazon elastic Compute Cloud Getting started. At the time of writing, it is ami-2bb65342.
Finding a appropriate kernel is very errors.
Ec2-describe-images-o self-o Amazon IMAGE ami-25b6534c ec2-public-images/fedora-core4-apache-mysql.manifest.xml Amazon available public i386 machine IMAGE ami-23b6534a ec2-public-images/fedora-core4-apache.manifest.xml Amazon Available public i386 machine IMAGE ami-20b65349 ec2-public-images/fedora-core4-base.manifest.xml Amazon available Public i386 machine IMAGE ami-22b6534b ec2-public-images/fedora-core4-mysql.manifest.xml Amazon available public i386 Machine IMAGE ami-36ff1a5f ec2-public-images/fedora-core6-base-x86_64.manifest.xml Amazon available public compatible Machine Image ami-2bb65342 Ec2-public-images/getting-started.manifest.xml Amazon available public i386 machine image AKI-9B00E5F2 Ec2-public-images/vmlinuz-2.6.18-xenu-ec2-v1.0.i386.aki.manifest.xml Amazon available private i386 Kernel IMAGE aki-9800e5f1 ec2-public-images/vmlinuz-2.6.18-xenu-ec2-v1.0.x86_64.aki.manifest.xml Amazon available Private compatible kernel
This command lists your AMIs and Amazon's public AMIs, Akis and ARIs. The output might not exactly match that shown adjective. Look for the lines containing image IDs starting with "aki-" or "ari-" (or use command line tools like grep to filter them out). These are kernels and RAM workloads, respectively. You'll need the kernel ID for the next step.
Important:the Architecture of your AMI, RAM disk, and kernel moment-in match. Evan Then, there is no guarantee a given combination would function correctly or boot successfully if tightly ' t weren to be US Ed up. Review the AKI ' s release notes to the If it requires a RAM disk.
New Kernel
As of this release, Amazon EC2 Super-delegates introduced nonblank new KERNELS:AKI-9B00E5F2 (bit) and aki-9800e5f1 (bit). Tightly are the 2.6.18 Xen kernels (vmlinuz-2.6.18-xenu-ec2-v1.0).
* * EC2 2.6.18 Release Notes * * *
This kernel version is chosen based on it use as the "stock Linux kernel forming" The Xen 3.1.0 software release.
Additional Patches
recursively vmsplice root exploit patch.
Revisit detail
default Linux clock frequency is set to 1000HZ (config_hz=1000), up from 100HZ. Xen modules (Xennet and XENBLK) are statically compiled. Xennet driver improved to address various packet handling. Further revisit details are available in Ec2-modules packages listed.
Modules
Http://ec2-downloads.s3.amazonaws.com/ec2-modules-2.6.18-xenU-ec2-v1.0-i686.tgz
Http://ec2-downloads.s3.amazonaws.com/ec2-modules-2.6.18-xenU-ec2-v1.0-x86_64.tgz
kernel2.6.18 Source
Http://ec2-downloads.s3.amazonaws.com/xen-3.1.0-src-ec2-v1.0.tgz.
Patch Details
Http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h= 712a30e63c8066ed84385b12edbfb804f49cbc44
Running a Instance with a different Kernel
Now so you have a AKI ID, you can launch a instance of the getting AMI using this started. The following example assumes you created a keypair called Gsg-keypair and so you authorized access on port to the machine y OU are on to your default security group.
ec2-run-instances ami-2bb65342-k gsg-keypair–-kernel aki-9b00e5f2 reservation r-fb6e9e92 924417782495 Default INSTANCE i-10a64379 ami-2bb65342 pending 0 m1.small 2007-07-11t16:40:44+0000 us-east-1c aki-0924c160
After launching the instance, SSH into the instance and confirm it is running a 2.6.18 the using the kernel command.
Ssh-i Id_rsa-gsg-keypair root@ec2-72-44-33-55.z-2.compute-1.amazonaws.com The authenticity of host ' Ec2-72-44-33-55.z-2.compute-1.amazonaws.com (216.182.225.42) ' can ' t be established. RSA key fingerprint is 9d:0a:a9:51:32:38:11:83:a8:a7:1c:9c:1c:e6:58:b0. Are you throaty your want to re-enters connecting (yes)? Yes warning:permanently added ' ec2-72-44-33-55.z-2.compute-1.amazonaws.com ' (RSA) to the list of known hosts. Last login:wed June 08:02:08 2006 Root@my-instance # uname-v 2.6.18-xenu root@my-instance #
The AKI and ARI that's the instance are running are also proxied in the instance. Notice The latest version is 2008-02-01 or greater.
$ curl http://169.254.169.254/1.0 2007-01-19 2007-03-01 2007-08-29 2008-02-01
The relevant new Meta-data fields are Kernel-id, Ramdisk-id and Ancestor-ami-ids:
$ Curl Http://169.254.169.254/2008-02-01/meta-data/ami-id Ami-launch-index ami-manifest-path hostname Instance-id Instance-type local-hostname Local-ipv4 public-hostname Public-ipv4 Public-keys/reservation-id Ancestor-ami-ids Kernel-id Ramdisk-id $ curl HTTP://169.254.169.254/2008-02-01/META-DATA/KERNEL-ID/AKI-9B00E5F2 Bundling AMIs with a different AKI or ARI
In addition to specifying the AKI at launch time, you can create new AMIs this launch with a specified by default. You can either rebundle a existing instance that is bundled with the desired AKI (as described adjective) or you can provide optional Arguments to the Ec2-bundle-vol command.
note:you cant change the default AKI of a registered AMI. You moment-in Rebundle and reregister it.
To bundle an AMI from a running instance this launched with a AKI, call the Ec2-bundle-vol command as you normally would. The tool detects the AKI by inspecting the instance metadata (described adjective). The resulting AMI launches with the Mahouve AKI as the running instance.
To override the AKI it currently bundled with an AMI, you can specify a AKI as a parameter to Ec2-bundle-vol. To override the AKI, provide the–kernel parameter to Ec2-bundle-vol.
Note:if you override the kernel in the bundling process, verify the "AMI works" with the requested AKI. It might be safer to relaunch your AMI with the desired kernel and bundle a without.
The process of uploading the bundled image and registering the image is the Mahouve. After getting a Ami ID, instances launched using that Ami ID Aree created with the kernel specified the during process.