I know the post is old but I'll add my 5 cents.
I'm running Gentoo on several EC2 instances with no problem at all. If you are still on free tier period you can use it on t1.micro and t2.micro instances without any extra charges (provided you keep your resource usage within the free tier limits).
You can boot a pre-existing (and bloated) AMI, attach a new volume to it, and follow the standard* procedure to install Gentoo on that second volume or instead, as I prefer, install Gentoo on a chroot in your local environment and then use rsync to copy your chroot to the volume (if I recall well Amazon does not charge for inbound network traffic). The only thing left will be to install Grub on the volume.
* Things you will need besides the ones stated in the hadbook:
- Use a Hardware Virtual Machine (HVM) instance type, and not a Paravirtual (PV).
- Enable all Xen related kernel options
Code: Select all
Processor type and features --->
[*] Linux guest support (CONFIG_HYPERVISOR_GUEST) --->
[*] Enable paravirtualization code (CONFIG_PARAVIRT)
[*] Paravirtualization layer for spinlocks (CONFIG_PARAVIRT_SPINLOCKS)
[*] Xen guest support (CONFIG_XEN)
[*] Support for running as a PVH guest (CONFIG_XEN_PVH)
Device Drivers --->
[*] Block devices --->
<*> Xen virtual block device support (CONFIG_XEN_BLKDEV_FRONTEND)
[*] Network device support --->
<*> Xen network device frontend driver (CONFIG_XEN_NETDEV_FRONTEND)
- For your grub/fstab use /dev/xvda1 as your root device.
- For automatically setting the host name and SSH keys on boot time, install app-admin/amazon-ec2-init and add it to the boot runlevel.
And that is pretty much all. I have a few t2.micro instances running a webstack (nginx, php, mysql, git, ...) using less the 2GB each. Usually I dont need to install packages on them but juts in case, they are configured to use another c3.4xlarge instance as a
BINHOST. Search the forums for keeping the Portage tree in a squashfs file (around 50MB).
One quick tip for facing less charges: keep the volume/snapshot/AMI size of your base Gentoo install as small as possible (around 3GB should be fine) and every time you launch a new instance from that AMI/snapshot, resize the volume size to a more real world value (such 10GB). When you boot the instance the partition and filesystem size will still be the small one but you can resize them live without problem. For resizing the partition just delete it and create it again using fdisk/gdisk (no worry, your data won't get lost). Then reboot and use the command 'resize2fs /dev/xvda1' to resize the filesystem while still mounted (again, your data won't get lost).
I hope it helps.