Rackspace Cloudvent Calendar Day 18: Packer And Rackspace

In the spirit of the holiday season, I’m sharing some tips and features of our cloud that you may not know about. In this countdown I’ll have 24 posts for you, each covering a single topic or feature about Rackspace Cloud products. We’ll post one per day so keep checking back!

On day 11, we went over using Vagrant with the Rackspace Cloud. Today I want to cover another tool by Mitchell Hashimoto: Packer. Packer is a tool for creating identical images for multiple platforms from a single source configuration. Packer supports multiple cloud providers: Rackspace, AWS, Digital Ocean and others. Let’s look at how we can use Packer to make images on Rackspace. First, go ahead and install Packer.

Packer uses JSON templates to define an image. Packer takes this JSON and runs the builds defined, producing a machine image. For OpenStack-based clouds, the JSON would look similar to this:

  "type": "openstack",
  "username": "YOUR_USERNAME",
  "password": "YOUR_APIKEY",
  "provider": "rackspace-us",
  "region": "ORD",
  "ssh_username": "root",
  "image_name": "Test image",
  "source_image": " 80fbcb55-b206-41f9-9bc2-2dd7aac6c061",
  "flavor": "2"

"provisioners": [{
    "type": "shell",
    "inline": [
      "sudo apt-get update",
      "sudo apt-get install -y mysql-server"

Here, we’re using the shell provisioner to install MySQL. You can use other provisioners as well like Chef, Puppet, Salt or Vagrant. This is a great way to bootstrap your Cloud Servers for further automation with a configuration management system. To actually build the server, just run the “packer build” command:

packer build template.json

Check back tomorrow for more!


  1. Hello, Hart!

    I’ve tried to do this, but get an error:

    ➜ packer git:(master) ✗ packer build -only=openstack ubuntu64.json
    openstack output will be in this color.

    Build ‘openstack’ errored: Expected HTTP response code [200]; got 401 instead

    ==> Some builds didn’t complete successfully and had errors:
    –> openstack: Expected HTTP response code [200]; got 401 instead

    ==> Builds finished but no artifacts were created.

    ➜ packer git:(master) ✗ packer –version
    Packer v0.5.2.dev (8a1364dbd817bd93b4d694eee03b208a20c22ade+CHANGES)

    Is it still actual with v2 version of API?


Please enter your comment!
Please enter your name here