How to build your custom Fedora 18 cloud image


13/02/2013 - Laurent Eschenauer (@eschnou)

In this post, we'll show you how easy it is to deploy a custom Fedora 18 instance on a Public (Amazon, Rackspace) and Private (Cloudstack, Eucalyptus, Openstack) cloud using a Kickstart file. With this procedure, you don't need to find an existing cloud image (e.g. AMI) matching your requirements or wait for someone to build one. Using a kickstart also enable you to easily customize your partition table, for example using a different filesystem or enabling encryption.

Using a kickstart file in the cloud

ComodIT is able to install machines on cloud platforms without having to rely on a pre-installed image. It can execute a completely automated install using either a kickstart file (RHEL/CentOS), or a preseed (Debian/Ubuntu). You can even ‘manually’ install your host, going through the install process via a secure VNC console.

This feature makes it really easy to build new images, without having to go through a painfull process of manually preparing an image off-line and then uploading it to the cloud provider.

Step-by-step guide

1. Pre-requisites

We assume that you already have a ComodIT account properly setup, and that you have configured it to deploy machines on a cloud platform. If not, please follow one of our tutorials depending on your cloud platform.

2. Fetch the Fedora 18 Cloud Image Builder Distribution

Once logged in, go to the ‘Distribution’ section and click the Browse Distribution Store button. In the featured distribution, search for the ‘Fedora 18 Cloud Image Builder’ and click the Get it for free button.

Once in your account, you can look at the details of the distribution. In the files section, you will see the kickstart template, and you can make changs to it based on your needs.

3. Deploy a host

Now that your distribution is ready, go to the ‘Hosts’ section, click the Add button and go through the following steps:

  • Describe the host: In the host creation wizard, enter a name, a description and click next.
  • Pick a platform: In the platform configuration, select your cloud platform on which to deploy the host. The larger the instance size, the faster the install process will be. On Amazon EC2, we recomend using a m1.large instance for the build process.
  • Pick a distribution: Pick your Fedora 18 Cloud Image Builder distribution, change the root password and click Finish

Select your newly defined host and click the Provision action from the ‘Host Actions’ menu. ComodIT will launch the provisioning of your machine, its state is changed to a little clock icon while it builds. When done, the machine will be powered off so that you can snapshot it and generate your Cloud Image. This may take some time (5-10+ minutes depending on the instance type and configured repositories).

Note that during the install process, since we have enabled the vnc option in the kickstart, and if you have opened a port in your security group to expose the vnc port 5901 from the instance to ComodIT Public IP), you can follow the progress of the install by clicking the ‘Show VNC Console’ in the ‘Host Actions’.

4. Snapshot your machine and create a Cloud Image

This process depends on your cloud provider and has to be performed using your cloud platform tools. It usually requires to create a ‘snapshot’ of the machine (or its volume) and then registering this snapshot as a new machine image.

In this previous tutorial, we go through these steps to create an AMI on Amazon EC2.

5. Use your new cloud image within ComodIT

In order to use your new cloud image with ComodIT - Create a new distribution (click Add in the distribution section) - Select a flavor that matches your cloud platform (e.g. EC2 AMI) - Fill in the reference of the cloud image on the given platform (note: on Amazon, you can leave the Aki empty to use a default one) - Update the userData script (in the Files section) to install the ComodIT Agent on boot

blog comments powered by Disqus