Tuesday, January 31, 2012

Image creation, part deux

My last blog post was a long and quite hackish procedure for running a Fedora install on a live instance in a Eucalyptus 3 cloud... and now I'm going to show you the easier way to build an image.  I spent some time kicking around ami-creator, and I only ran into a few small issues.  I've forked it on github and committed the necessary changes.  There is a sample kickstart file in the source tree.  Installation is a snap (sorry for not having it in rpm form, but that wasn't the goal of the day):
  • easy_install ez_setup
  • git clone https://github.com/eucalyptus/ami-creator
  • cd ami-creator
  • python setup.py build
  • python setup.py install
  • mkdir ~/f16-image
  • cp ks-fedora-16.cfg ~/f16-image/
  • cd ~/f16-image
  • optionally, go modify the kickstart file to point to your mirror, add the packages you want, change the disk size, etc.
  • ami-creator -c ks-fedora16.cfg -n f16test -v -e
When  the process completes, you'll have a few new files in the current directory:
  • f16test.img
  • initramfs-3.2.2-1.fc16.x86_64.img
  • initrd-plymouth.img
  • vmlinuz-3.2.2-1.fc16.x86_64
You can ignore initrd-plymouth.img.  Just go through the normal steps of bundle, upload, and register for each of the other three files, and you should have a working Fedora EMI.  It can't get much simpler than that.  Thanks to Jeremy Katz for starting the ami-creator project.  I hope that someday we'll see this rolled into the live image tools project where it belongs.



2 comments:

  1. I'll try to take a closer look at the patches in the next few days but the idea of it being standalone is actually intentional. The original idea (that I never fully pushed to fruition) is that the imgcreate bits are used by a bunch of tools like livecd-creator, appliance-creator, ami-creator and more without having to require a central person caring and feeding for all of them.

    ReplyDelete
  2. Sorry about this one!
    I just bundled, uploaded and registered one by one the image files f16test.img, initramfs-3.2.2-1.fc16.x86_64.img and vmlinuz-3.2.2-1.fc16.x86_64.

    This resulted in three ami-XXXXXXXX ids.

    Then I just tried to launch the AMI whose origin was f16test.img, but it does not launch. Well, it says "running" but it does not pass the two status ckecks that AWS performs on instance launching.

    Would you be so kind of explaining how to make those images work together in AWS so the instance can be launch succesfully?

    I would highly appreciate your help regarding this matter since I´ve expending the last two days making all kind of trials and right now I have no clue what I am doing right or wrong.

    Thank you very much in advance.

    ReplyDelete