This Time Self-Hosted
dark mode light mode Search

My first experiences with with Amazon EC2

It really shouldn’t be a surprise for those reading this post that I’ve been tinkering with Amazon EC2 in the past few days, the reason for that is that you can find it out by either looking at my stream or at my commit feed and noticing how I ranted about EC2 and bumped the tools’ packages in Gentoo.

As a first experience with EC2, I have to say it does not really come out very nice… Now, the whole idea of EC2, doesn’t look half as bad. And on the whole I do think the implementation is also not too bad. What is a problem is the Gentoo EC2 guest support: while Amazon “boasts” support for Gentoo as a guest operating system, there is no real support for that out of the box.

*Incidentally, there is another problem: the AWS Web Console that Amazon make available killed my Firefox 3.6 (ground to a halt). I ended up installing Chromium even though it stinks (it stinks less than Opera, at least). It seems pretty much faster, but it’s lacking things like the Delicious sidebar, still. Seems like my previous post wasn’t totally far off. Sure there are extensions now, but as far as I can tell, the only one available for Delicious does not allow you to use Delicious as it was your bookmarks.*

The first problem you might have to affront is finding an image (AMI) to use Gentoo.. I could only find one (at least in the European availability zone), which is … a stage3. Yes a standard Gentoo stage3, without configured network, without SSH, without passwords, … Of course it won’t start. I spent the best part of three hours last night trying to get it to work, and at the end I was told that the only way to work that around is to install using Ubuntu as it was a live CD installing Gentoo on a real system. Fun.

So start up Ubuntu, create an EBS (stable storage) for the Gentoo install, install it as it was a normal chroot, create the snapshot and… here is one strange behaviour of Amazon: when you connect a new EBS volume to an instance, it is created as a block device (say, sdb). When you use a snapshot of that volume to register a machine (AMI), it becomes a partition (sda1). If, like me, you didn’t consider this when setting it up for install, and partitioned it normally, you’ll end up with an unbootable snapshot. Fun ensures.

By the way, to be able to register the machine, you have to do that through recent API tools, more recent than those that were available in Portage today. Hoping that Caleb won’t mind, I bumped them, and also made a couple of changes to the new API/AMI tools ebuilds: they now don’t require you to re-source the environment every time there’s an upgrade, and the avoid polluting /usr/bin full of symlinks.

So you finally complete the install and re-create the AMI, start an instance and… how the heck is it supposed to know your public key? That’s definitely a good question: right now there in Gentoo there is no way for the settings coming from Amazon to e picked up by Gentoo. It’s not difficult, and it seems to be documented as well, but as it is it’s not possible to do that. As I don’t currently need the ability to generate base images, I haven’t gone further pursuing that objective, on the other hand, I have some code that I might commit soonish.

Anyway, if you got interest in having better Gentoo experience on EC2, I might start looking into that more, in the future, as part of my general involvement, so let your voice be heard!

Comments 10
  1. I’ve been using/tinkering with EC2 for a good while as well and have had to use the same route as you for installing Gentoo. I’m currently doing some homework on drobbins Metro so it can assist me in creating a stage3 ready for upload. What are your goals with ec2? Perhaps we could look into doing something collaborative?

  2. If anything tied to Robbins is involved? Unlikely. I like doing my stuff properly, while he cuts any corner he can, systematically.There isn’t really any work *I* need with EC2 right now; the stuff I need for my task now is complete. And I don’t have much to tinker to get the stages: if I wanted to build it locally, I could set up catalyst to build me a stage4 (actually, 3.5) quite quickly. What should be worked on instead is an init script that could handle the instance configuration. I have something here that should be working, but I cannot go on testing yet.And actually, the stage 3.5 problem would be easy to solve given two preconditions: getting OpenRC stable, and have proper “guest profiles”, like “one for lxc”:… that will disable from the system set the stuff that is not strictly needed. It also would be helpful if we were to “reduce the size of system anyway”:… as I proposed two years ago.As you can see, to get it done properly there are quite a few things that need to be fixed up. I’m not just going to get the quick way of hacking up a single stage that works, I can do that easily. What I would like is for Gentoo to provide proper support.

  3. And I have had enough contact with him to wonder how hard the rest of the team had to work at the time for Gentoo not to turn up crap.Really, he might be a decent visionary, but when it’s time for implementation, he’s just not the kind of guy I’d rely on. At all.

  4. I spent a lot of time doing gentoo work on EC2, but I have moved on to other projects. I have custom AMIs tuned up that I built with metro for each of the architectures, but they have some customer specific info in them as well, which is why they aren’t public.The biggest issue right now is that the stock amazon kernel is 2.6.18, and that won’t work with the latest udev in gentoo. There are newer ubuntu kernels, but I couldn’t get them to work with Gentoo for the time I spent on them.

  5. You didn’t have to slag drobbins in public to hold that position. That was just mean. Part of the meanness that drives people away from Gentoo development.

  6. Justy, you most likely haven’t followed the way *he* went to attack _my_ work before.And really, I don’t intend to feel criticised by somebody who can’t even tell that the email field is optional, and fills it with faux credentials.@Caleb, yeah I noticed that about the kernel, if it wasn’t for the attach/detach of EBS volumes, it would be just as well to use a static @/dev@…As I said, I would probably like to spend some time to get them to work, but it’s going to take a while.

  7. I used the gentoo stage3 which came up in the search (ami-c9b991bd) , and am not having any issues. Seems to have been built with a xen kernel:ip-10-227-102-80 ~ # uname -aLinux ip-10-227-102-80 #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 Intel(R) Xeon(R) CPU E5430 @ 2.66GHz GenuineIntel GNU/LinuxIs that the same one you had trouble booting?

  8. What kernel version/options do you need for the latest udev to work. I have been booting custom 10.1 images using Rick0’s(1) instructions and masking >=sys-fs/udev-125.This runs fine with the Ubuntu 2.6.32 kernel (Singapore) aki-a9f38cfb1. http://rich0gentoo.wordpres

  9. What is the Status with Gentoo on EC2 on Amazons cloud? Do we now have an easier way to setup? I am willing to provide some funding for some testing.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.