Getting a new server is the easy part. Moving it from the cardboard box to production is where the struggle begins in most organizations. The first step in solving this problem is RackHD. We’ve talked about RackHD before, but to quickly summarize it’s a configuration management tool with a built-in workflow engine to provision bare-metal compute, storage, and networking. RackHD allows you to plug in a network cable, press the power button, and then let automation take over. The next step is figuring out how to add that host to a Docker Swarm cluster to be managed by native Docker tools and ready to run containers. Docker Machine is the tool of choice when it comes to provisioning new hosts on different types of infrastructure. So how do we connect the two?

Introducing the Docker Machine Driver for RackHD.

dmd-rackhd-00

Today’s v0.0.1 focuses on the creation of a new Docker host using nodes that have been registered to RackHD. To see the commands available, install RackHD binary and use the --help flag.

dmd-rackhd-03

The creation of the new host is explicitly done by specifying the unique ID of the node that has been registered to RackHD. Of course the RackHD instance is unique in everyone’s situation so the flag for rackhd-endpoint is available to specify where the on-http service is running. SSH is a requirement by Docker Machine to access the host and install Docker. The default SSH username and password combo is root/root but can be easily overridden using the rackhd-ssh-user and rackhd-ssh-password flags or environment variables.

The deployment goes through a pre-create process to verify the RackHD API accessible, then queries it to retrieve the Node IP address. Once the IP address is available SSH, public keys are generated and added to the host, then Docker Machine takes over to inspect the OS flavor and install Docker.

dmd-rackhd-02

A real example of putting this to work is creating a cluster of Docker Swarm hosts using RackHD nodes. Watch this quick video below to get a quick overview of all the tools and see it in action.

This driver is still in its infancy and needs more work, but the bare minimum is there today for the create functionality. RackHD is experiencing heavy development and the APIs are changing by the hour. This current version relies on the 1.1 API but the 2.0 API is around the corner. In addition more work needs to be done to integrate the Redfish API, which performs machine actions into the gorackhd binding. However, this is going to be put on hold until these APIs get stabilized, fleshed out, and combined.

Click the star to keep updated on new updates to the integration work. https://github.com/emccode/docker-machine-rackhd

Want to give it a spin? Read Docker Machine Driver for RackHD Vagrant Example for a step-by-step tutorial creating an isolated environment and using Docker Machine with the RackHD driver to create your own Docker Swarm Cluster.