View previous topic :: View next topic |
Author |
Message |
sk3l Tux's lil' helper
Joined: 14 Jul 2012 Posts: 78 Location: CT USA
|
Posted: Thu May 22, 2014 5:45 pm Post subject: Anyone Running Gentoo on Amazon AWS? |
|
|
I've some experience administering EC2 instances for work. I'm considering trying to build out a Gentoo instance on Amazon, but I'm a little unsure if I can use a Gentoo AMI to run in the free usage tier. The guys at Dowd & Associates have put together a few Gentoo Amazon AMIs, but I would prefer to use a distro that I can fit under the free tier. Thanks for any info/wisdom. |
|
Back to top |
|
|
rich0 Developer
Joined: 15 Sep 2002 Posts: 161
|
Posted: Sun May 25, 2014 10:40 pm Post subject: |
|
|
There aren't really any special requirements for the free tier besides running a micro instance, and some limitations on storage/IO/etc. I haven't run the Dowd images but I imagine they would work fine on the micro instance. I've worked on a bootstrap script derived from theirs and routinely ran them on the micro instance for testing (they merged back most of my improvements, and likely have gone beyond them since).
I haven't updated my scripts for a while, though I suspect they should be close to working (biggest issue would be if Amazon changed their device mappings, the kernel/udev renamed devices, or Amazon changed their kernel/grub requirements). Somebody recently took an interest in getting Catalyst working for EC2 so I might spend a bit more time migrating some of the configuration into a package.
My blog has instructions for rolling your own image, based on the work of Dowd/Associates. Or you can use theirs, of course.
Just keep an eye on IO use - in my experience EBS volumes can eat up quite a bit of this depending on application and your hourly rate can end up being higher than expected. |
|
Back to top |
|
|
sk3l Tux's lil' helper
Joined: 14 Jul 2012 Posts: 78 Location: CT USA
|
Posted: Mon May 26, 2014 12:12 pm Post subject: |
|
|
Hi Rich, I did read your blog as well. Thanks for putting time into breaking down how to create our own images. I actually may eventually go that route instead of using a pre-canned AMI so I can have better control over its contents.
I think my confusion stems from what I thought was an added requirement to the free tier, which was that only AMIs marked "free tier eligible" could be used in that capacity. I have read mixed commentary about the accuracy of this requirement, and IMO Amazon has done a poor job in clarifying this point.
For the time being, I fired up a CentOS instance, which is actually good because I'd never monkeyed with that distro before. |
|
Back to top |
|
|
rich0 Developer
Joined: 15 Sep 2002 Posts: 161
|
Posted: Mon May 26, 2014 12:17 pm Post subject: |
|
|
sk3l wrote: | I think my confusion stems from what I thought was an added requirement to the free tier, which was that only AMIs marked "free tier eligible" could be used in that capacity. I have read mixed commentary about the accuracy of this requirement, and IMO Amazon has done a poor job in clarifying this point. |
I think that there are only issues with RHEL or other licensed distros, which provide AMIs on AWS.
FYI - I just updated my bootstrap scripts and they work just fine - at least for a base install (I doubt anybody runs kde/gnome on ec2 anyway - they were more proof-of-concept than anything). |
|
Back to top |
|
|
Stolz Moderator
Joined: 19 Oct 2003 Posts: 3028 Location: Hong Kong
|
Posted: Wed Nov 26, 2014 10:55 am Post subject: |
|
|
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: | 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. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|