Home > Linux > Archlinux EC2 Public AMI

Archlinux EC2 Public AMI

April 5th, 2009

I made 2 public Archlinux EC2 AMI.

Important Notes:

  • Most instructions on this page are outdated. All necessary packages have been included inside latest AMI
  • If you want to build your own AMI, I released this build script on gitub and aur packages.

Update 2011/1/25

Update kernel to 2.6.37 and fix account creation.

Update 2010/8/30

Change static ip to kernel dhcp and remove initrd

Update 2010/8/28

The network configure will be saved when image first time booted. If you want to revert to dhcp in case you need to rebuild or stop. You should run this

sudo /etc/rc.d/ec2 stop

I also changed default cflags, so if you want to recompile packages, you can use srcpac. For example

sudo abs extra/python
sudo srcpac -Sb python

Update 2010/8/21

Add a user arch with the same ssh key as root.

The hostname is now static, if you want to rebundle, make sure change HOSTNAME in rc.conf to myhost and remove last line of /etc/hosts.

Here is the new build script.

Update 2010/7/23:

Updated to BTRFS as root.

Update 2010/7/20:

Updated to pvgrub and EBS.
Here is the updated script to generate an EC2 EBS.
I also made an aur package for kernel26 with patch from gentoo and opensuse.

There is a simple patch for mainline kernel from amazon.

Arch AMI ID
i386 ami-5ae11133
x86_64 ami-84e111ed

Updates:
10/21/2009: Updated all packages and use ubuntu kernels. Here is the new AMI making script. Those kernels will load some unnecessary modules, you will need to unload them manually. I will update again if I can found more stable kernel.

They are very basic installation with just ssh. If you need tools like ec2-ami-tools or ec2-api-tools, you can find my aur packages here. Or you can add my private repo to your pacman.conf.

[iphash]
Server = http://static.iphash.net/public/i686/

or

[iphash]
Server = http://static.iphash.net/public/x86_64/

Then

pacman -Sy ec2-ami-tools ec2-api-tools

If you want to roll your own image. Here (outdated - see beginning of this post) is the script I used to make these AMIs.

If you wish to set hostname and domainname you can pass following script as instance user-data.

MYHOST=yourhost    #set your real hostname here
MYDOMAIN=yourdomain  #set your domainname here
 
sed -i s/myhost/$MYHOST/ /etc/rc.conf
hostname $MYHOST
 
echo "NISDOMAINNAME=\"$MYDOMAIN\"" >/etc/conf.d/nisdomainname
nisdomainname $MYDOMAIN
 
/etc/rc.d/syslog-ng restart
 
x=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
if [ $(echo $x|grep 404|wc -l) -eq 0 ]; then
cat <<EOF>/etc/hosts
#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1               localhost.localdomain   localhost
$x  $MYHOST.$MYDOMAIN  $MYHOST
# End of file
EOF
fi
cp /etc/skel/.bash* /root/
Bookmark and Share  
 

Yejun Linux , , , ,

  1. August 20th, 2009 at 16:41 | #1

    Hey,

    Thanks for making this image! Arch is great. I tried using it and everything was working well until I tried to mount a XFS EBS volume, then my system halted. See below. I did notice when I first booted the instance dmesg showed me:

    udev: deprecated sysfs layout; update the kernel or disable CONFIG_SYSFS_DEPRECATED; some udev features will not work correctly

    Then after the mount:

    Aug 20 17:29:09 myhost kernel: kernel BUG at arch/i386/mm/hypervisor.c:185!
    Aug 20 17:29:09 myhost kernel: invalid opcode: 0000 [#2]
    Aug 20 17:29:09 myhost kernel: SMP
    Aug 20 17:29:09 myhost kernel: last sysfs file: /block/sdh/uevent
    Aug 20 17:29:09 myhost kernel: Modules linked in: xfs(U) pcspkr(U) ext3(U) jbd(U) mbcache(U) uhci_hcd(U) ohci_hcd(U) ehci_hcd(U) xenblk(U) xennet(U)
    Aug 20 17:29:09 myhost kernel: CPU: 0
    … plus a lot more bad stuff …

    Have you had any bad experiences with this?

    Peter

  2. tamir
    September 14th, 2009 at 01:33 | #2

    same here buddy. the same message was shown to me when i tried it at my end. please let me know what is wrong with it so that i may proceed painlessly with my it certifications

  3. nonie
    September 14th, 2009 at 03:59 | #3

    same here buddy. the same message was shown to me when i tried it at my end. please let me know what is wrong with it so that i may proceed painlessly with my it it certifications

  4. October 12th, 2009 at 12:11 | #4

    @Peter Kieltyka
    Probably you can try different kernel and ramdisk. Replace the –kernel aki-a71cf9ce –ramdisk ari-a51cf9cc with something else in the build script.

  5. October 20th, 2009 at 22:21 | #5

    Updated to newer kernel and packages.

  6. October 21st, 2009 at 01:45 | #6

    Hey Yejun,

    We are indexing your images at The Cloud Market allowing people to search for them
    http://thecloudmarket.com/owner/545611693861

    You can update your info and the info about the images if you wish, by following the instructions at http://thecloudmarket.com/about.html#/claiming

    Hope you find our site useful

  7. November 17th, 2009 at 04:32 | #7

    I’ve written a tutorial which uses this AMI. http://ananelson.com/1 I haven’t been able to get the i686 version to launch on Amazon, but the x86_64 is working really well and I’m using it to run simulations. Also, the 2 older AMIs you built are still up on Amazon — not sure if you want to take them down?

    Many thanks for contributing this!

  8. Bryan Ischo
    December 7th, 2010 at 19:59 | #8

    Thank you for your great work on the makearchec2.sh script.

    If I could, however, I would like to offer some suggestions.

    I would prefer to see a script that didn’t ‘editorialize’ the Arch installation so much. Your script does things like replaces the bash shell with zsh in /etc/passwd, creates unnecessary users (arch), messes with root’s login scripts, etc. I don’t see why you wouldn’t just do those things via a separate script that you run when you first log into your newly created instance - why force everyone who uses your script to adhere to your preferences?

    I think that the goal of such a makearchec2.sh script should be to produce an Arch Linux AMI that is as close as possible to a core Arch install. Then people can customize their instance after starting it up for the first time using a plain vanilla Arch Linux install that has everything set up the way they would normally expect. I am already in the process of making my own tweaked version of makearchec2.sh and the ec2 script that adhere more closely to these principles.

    Additionally - why make the root filesystem be a compressed btrfs filesystem? Maybe this works well on Small and larger instances, but it is terrible for micro instances. Micro instances are severely CPU limited, and the compression that has to happen with your compressed btrfs filesystem really hammers the instance unnecessarily. How much space is saved by using a compressed filesystem? Pennies per month? Doesn’t seem worth it to me.

    Once again your effects are extremely appreciated, hope my comments don’t seem contradictory to that sentiment.

  1. July 24th, 2010 at 18:28 | #1