8

after Amazon announced the new EBS based AMIs, I'm wondering if it is or will be possible to create new AMIs that are not based on the existing Fedora/Windows AMIs. The documentation says:

The easiest method involves starting from an existing public AMI and modifying it according to your requirements. This is applicable for both Amazon EBS-backed and Amazon S3-backed AMIs, and is described in Starting with an Existing AMI.

Another approach is to build a fresh installation either on a stand-alone machine or on an empty file system mounted by loopback. This is only applicable for AMIs backed by Amazon S3 and entails building an operating system installation from scratch.

That sounds like all future AMIs have to be based on existing ones, but that would be very limited. Do I understand this correctly or are there any other ways of creating AMIs not based on existing ones? I would be interested in creating ubuntu AMIs.

4 Answers 4

3

http://www.elastician.com/2009/12/creating-ebs-backed-ami-from-s3-backed.html

1
  • 2
    Please reproduce the important part of your link in your answer. You have no guarantee the site you linked to won't disappear in future, making your answer worthless. Apr 19, 2019 at 23:36
2

For Ubuntu in particular you could try these instructions http://alestic.com/2010/01/vmbuilder-ebs-boot-ami.

2

Here's a script I use to build a Git/gitolite server AMI using the downloadable Ubuntu server file system as a base:

https://github.com/alestic/alestic-git/blob/master/bin/alestic-git-build-ami

Here's more info about the Alestic Git server project for EC2:

http://alestic.com/alestic-git/

The vmbuilder-ebs-boot-ami article I wrote on Alestic.com (linked to in the answer by Bribles) is now outdated.

1

AMIs do not have to be based on existing ones, but creating one from EC2 is convoluted because it gives you a computer with remote access and hardware configuration but no console input.

The trick here is that ISO images can be booted directly from hard disk if they include a boot sector. Also, installation of the new OS needs to be completely automated because you won't be able to interact with the console when the installer is running.

You will need to use three EBS disks, and switch which ones are attached: development, the installer and the final result.

  1. Start an EC2 instance with an existing AMI.
  2. Edit the ISO image for your new OS to make an unattended install (i.e. loopback mount, copy files, edit, mkisofs, isohybrid). For Ubuntu you need to edit the preseed file and isolinux.cfg. The install must write to a fresh EBS disk that will become the new AMI.
  3. Copy the edited ISO image to a third EBS disk and boot from it.

I created an AMI for Linux Mint 18.2 using this method (starting with Amazon AMI Linux) as described in detail here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .