CloudSigma delivery tutorial

BoxGrinder Build encapsulates powerful functionality, such as the ability to define, build and deliver an appliance, into a simple and concise pipeline. Ultimately, only a single command needs executing in order to build, convert and deliver a custom-defined appliance into your chosen environment.

For some use-cases appliances might only be run within internal or private infrastructure, hence BoxGrinder provides local file-system delivery and SFTP support. However, BoxGrinder also offers similarly succinct platform conversion and delivery methods for public infrastructure, and as of release 0.9.2 support has been added for CloudSigma, a provider of cloud services throughout Europe.

In this blog-post we demonstrate a basic, but complete, work-flow to specify, build and deliver an appliance to CloudSigma.

Define your Appliance

The starting point of any appliance is an Appliance Definition File; an extremely simple YAML text definition to describe the virtual machine you would like to produce. There is support for a wide range of features to customise the image for your specific requirements, however for this post we will only produce a simple definition to illustrate the pertinent functionality.

name: sigma-jeos
summary: Just Enough Operating System
  name: fedora
  version: 15
  password: boxgrinder-rules
    - /bin/echo "I am a CloudSigma appliance!" >> /what-am-i

Save the file as sigma-jeos.appl.

There are very few mandatory fields, in almost all instances a sensible value will be provided as a default. For instance, we leave BoxGrinder to provide a root partition, and a base set of packages to provide a functional Fedora OS. The only CloudSigma specific part of this appliance is in the post section, where we can specify commands to be executed after the standard build process has completed. In this example we echo a trivial message into a file, but you could perform any legal shell commands and BoxGrinder will run them on your behalf.

If you need to perform complex software installation and configration, it is advisable to encapsulate the scripts in RPMs, carefully describing the dependencies and requirements. Your scripts will be installed in the same phase as other RPMs, ensuring that any dependencies are properly resolved before execution occurs.

What's the Secret Number?

The CloudSigma plugin requires specific configuration information in order to deliver appliances. BoxGrinder stores this information in a consolidated plugins file, located at $HOME/.boxgrinder/plugins. As CloudSigma uses a variant of the ElasticHosts API, configuration is provided under this subsection.

    endpoint:                      # required
    username:       # required
    password: whisper                                 # required
    chunk: 128                                        # default: 64 (in MB)
    start_part: 0                                     # default: 0
    wait: 5                                           # default: 5 (in s)
    retry: 5                                          # default: 3
    ssl: true                                         # default: false
    #drive_uuid:                                      # optional
    #drive_name:                                      # optional

Only the endpoint, username, and password are required attributes, BoxGrinder will either use a sensible default, or derive a value where appropriate.

BoxGrinder Build, Make it So!

There is now sufficient information available to build, convert and deliver an appliance to CloudSigma. We now simply execute BoxGrinder Build with the CloudSigma delivery flag on the command line as root, and the hard work will be performed for us.

boxgrinder-build sigma-jeos.appl -d elastichosts

All packages required to build a basic Fedora 15 image will be downloaded and installed into a RAW imagefile. Once completed, the image is broken into chunks and uploaded to the CloudSigma account specified above.

BoxGrinder will inform you of the Server UUID and Drive UUID for your appliance.

I, [2011-05-18T18:55:27.201579 #14223]  INFO -- : Appliance f15-jeos uploaded to drive with UUID b161fd8b-d56s-4eea-9055-669daaec8aa4.
I, [2011-05-18T18:55:27.202616 #14223]  INFO -- : Appliance uploaded.
I, [2011-05-18T18:55:27.203164 #14223]  INFO -- : Creating new server...
I, [2011-05-18T18:55:28.155540 #14223]  INFO -- : Server was registered with 'f15-jeos-1.0' name as '02c80862-0282-4014-af28-d751fee1dead' UUID. Use web UI or API tools to start your server.


You can launch either via CloudSigma's API tools using the UUIDs, or the Web UI, where you should be able to see your newly uploaded appliance under My Servers and My Drives. After launching an instance, you can connect via SSH, with the root user account and password set in the appliance definition; boxgrinder-rocks.



With these simple steps, BoxGrinder Build has created a virtual appliance from scratch, and delivered it to the CloudSigma cloud. It is easy to envisage how BoxGrinder Build can be harnessed to bake a range of compact, specialised appliances to fulfil the roles you require in your deployed applications.

The easiest way to try out BoxGrinder Build is with our Meta Appliances, that provide a pre-configured environment ready for grinding out appliances.

Support for new Clouds is coming!

You know what's good? Support for a new Cloud. You know what's better? Support for many new Clouds!

I'm excited to share with you that with the upcoming 0.9.1 release BoxGrinder is going to support the following new Clouds:

It was possible because all the above listed Clouds share the same API for disk and server management, perfect! The API itself is really straightforward and makes the interaction with services easy.

At this point I would like to thank all the Cloud providers for their help on testing this, especially the ElasticHosts guys which answered all my stupid emails, thanks!

Support for these Clouds was added as the ElasticHosts plugin. Detailed usage and configuration instructions for this plugin can be found on the plugin page, but the basic usage is as simples as:

boxgrinder-build jeos.appl -d elastichosts

What's happening behind the scenes?

The basic workflow is:

  1. Build the appliance in the normal way.
  2. Create or re-use an existing disk in the Cloud with a specific size.
  3. Upload the disk image created previously (in chunks, so we can retry sending failed chunks) to the remote disk. The data is compressed to reduce the upload time.
  4. Create a new server in the Cloud with the newly created disk attached to it.

After this BoxGrinder returns the name and server UUID which is ready to launch!

Help with testing

This is immediately available from our nightly repository. Please grab the updated packages, test it and let us know how it went!

If you know any other Cloud that supports ElasticHosts API, please let us know too!

Which Cloud is the right one?

BoxGrinder supports more and more Clouds. Some of them are closer to your location than others. To help you find the nearest Cloud to you see our supported Clouds map. Hope you like it!