Base Amazon Linux AMI as Foundation

485 views
Skip to first unread message

Rob Sweet

unread,
Oct 4, 2013, 7:00:51 PM10/4/13
to amin...@googlegroups.com
HI, everybody.

I'm trying to use the base Amazon Linux AMI (ami-05355a6c) as my foundation AMI with Aminator and I've quickly run into a problem.  Before trying to install my RPM, Aminator tries to do a 'yum clean metadata', which breaks with an error that I have no yum repos enabled. I dug into it and it looks like /etc/init.d/cloud-init runs on boot and uses templates to write out /etc/yum.repos.d/amzn-main.repo (among others). Unfortunately, Aminator is only mounting the filesystem, not running init, so the file doesn't exist when Aminator runs the clean.

The best solution that I've come up with so far is to somehow get /etc/yum.repos.d/amzn-main.repo into the provision_config_files list so that the one from my Aminator box gets dropped in and then cleaned up later. Is there a way to do that aside from editing the system-wide aminator/plugins/distro/default_conf/aminator.plugins.distro.redhat.yml?

Another way to try to get around the issue could also be to run /etc/init.d/cloud-init after the chroot but before the yum call. I didn't see any way to hook in at that point but maybe there is one?

Is there another way to work around this that I'm missing?

Thanks for the help, guys.

Rob

Brian Moyles

unread,
Oct 9, 2013, 5:54:22 PM10/9/13
to amin...@googlegroups.com
Hey Rob,
One thing that's not immediately clear is you can create config files that override those defaults.
 Aminator will look in /etc/aminator for overrides for these configs (it will also check ~/.aminator)

For plugins, Aminator will look in /etc/aminator/plugins/. If you create aminator.plugins.distro.redhat.yml in /etc/aminator/plugins you can specify a provision_config_files stanza there on its own and it should get merged into the default config. I do believe that will override the default for provision_config_files, so you will need to specify resolv.conf there as well.

Let me know if that works for you.
Thanks!
Brian

Rob Sweet

unread,
Oct 15, 2013, 11:13:18 AM10/15/13
to amin...@googlegroups.com
Yep, that did the trick.  Thanks!  :)

Pierre Vocat

unread,
Feb 4, 2014, 11:21:29 AM2/4/14
to amin...@googlegroups.com
Hi Rob,

Hope you'll be able to point me in the right direction. I'm trying to use Amazon Linux AMI (ami-5256b825) as my foundation AMI with Aminator but don't know how you get the linux image onto the EBS volume.

I'm following the steps detailed in https://github.com/Netflix/aminator/wiki/Creation-of-an-Ubuntu-12.04-foundation-AMI. They download an ubuntu image "http://cloud-images.ubuntu.com/releases/precise/release/ubuntu-12.04-server-cloudimg-amd64-root.tar.gz". From what I've read you cant download Amazon AMI's?

Did you ever get this working, did you find any good documentation on this?

Kind Regards,
Pierre



This is an e-mail from the company Just-Eat Holding Ltd. This e-mail may contain confidential information and/or privileged or personal advice. This e-mail is intended for the addressee(s) stated above only. If you receive this e-mail by mistake, please return it to Just-Eat Holding Ltd without producing, distributing or retaining copies hereof. Thank you.

Peter Sankauskas

unread,
Feb 4, 2014, 12:44:31 PM2/4/14
to amin...@googlegroups.com
Hi Pierre,

Does the AMI ami-5256b825 have it's EBS snapshot publicly available? 

If it does, then you can just specify ami-5256b825 as your base AMI using the -B command line parameter when using Aminator.

If it doesn't, you may need to boot an instance running ami-5256b825, and then create an AMI from that, which becomes your Foundation AMI. It's not as clean, but it works.

--
Kind regards,
Peter Sankauskas

Brian Moyles

unread,
Feb 4, 2014, 1:01:21 PM2/4/14
to Peter Sankauskas, amin...@googlegroups.com
Amazon's AMIs have snapshots you can turn into a volume in your account. If you get the underlying snapshot ID, you can create-volume with that as the foundation--now you have your own private Amazon foundation AMI. I asked Canonical if they'd do the same for Ubuntu but it sounds like that is not a priority.


--
You received this message because you are subscribed to the Google Groups "Aminator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aminator+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Peter Sankauskas

unread,
Feb 4, 2014, 1:11:56 PM2/4/14
to amin...@googlegroups.com, Peter Sankauskas
Yeah, I have been pestering Ben Howard about Ubuntu too. He last said there was progress, and it should happen early this year.

Good to know the Amazon AMI snapshots are public!

Pedro Vilaça

unread,
Apr 17, 2014, 1:32:59 PM4/17/14
to amin...@googlegroups.com, Peter Sankauskas
Hi guys,

I'm new in the AWS world and I'm trying to understand how aminator works and how can I use it to create a custom AMI for my application. I was trying to follow the steps that are described in the wiki but it isn't very clear. Also, I found that ubuntu snapshots are already available in AWS, so I think that most of the steps can be avoided. As fas as I understood, I need a EC2 instance to be able to create/operate a EBS volume (already done and already configured with the chef recipe that you provided). Could you give me the next steps?

Thanks,
Pedro

Rob Sweet

unread,
Apr 17, 2014, 1:54:02 PM4/17/14
to Pedro Vilaça, amin...@googlegroups.com, Peter Sankauskas
Hi, Pedro. 

I did a presentation for the AWS Atlanta Meetup group about Aminator that might be helpful. I'm using Puppet rather than Chef but the idea is the same. Here's the video: http://youtu.be/UL_FI5hG3js

The instructions, slides, and Puppet manifests that I used are all available at http://github.com/robsweet/aminator_demo 

I hope that helps. :)

Rob

Sent from my iPhone
You received this message because you are subscribed to a topic in the Google Groups "Aminator" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aminator/xoD9L8odPH4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aminator+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Sankauskas

unread,
Apr 17, 2014, 2:08:23 PM4/17/14
to amin...@googlegroups.com, Pedro Vilaça, Peter Sankauskas
Also... an update:

A Foundation AMI is no longer required since both Ubuntu and Amazon have made the EBS snapshots of their AMIs public, so you can skip that step.

You can also take a look at the steps on my site (I think they all still work. Let me know if they don't):

--
Peter Sankauskas

Pedro Vilaça

unread,
Apr 21, 2014, 6:13:16 AM4/21/14
to amin...@googlegroups.com, Pedro Vilaça, Peter Sankauskas
Hi Peter and Rob,

Thanks for your help! I'll take a look and after that I'll let you know about the results.

Thanks,
Pedro
Reply all
Reply to author
Forward
0 new messages