Deploying to Rackspace using salt-cloud

Deploying Rackspace Cloud servers using salt-cloud.

These instructions should be a nice and easy start to deploying Rackspace Cloud servers using the salt-cloud tool. Just follow along exactly, and at the end you should have a fully functional salt-cloud deployment tool.

Dependencies

I’m performing my installation on a Debian 7 (Wheezy) server, where my salt-master already exists. The following two commands should install salt-cloud, and all the necessary dependencies. This assumes you are already using the Python tool pip.

apt-get install sshpass
pip install salt-cloud apache-libcloud

Configuration

Here are the configuration files we need to put in place. Replace the appropriate sections with your account information.

Deployment

Now, let’s deploy a test instance of the server we just defined.

salt-cloud -p openstack_512 testinstance

This should start outputting information on the process. The longest wait in this process will be the server’s build. Once it completes, you’ll see the output of salt-cloud logging into the server and running various commands to bootstrap the system. At the end, you should see output similar to the following:

To delete this test instance, just run the following command. It will prompt for confirmation before actually deleting the instance.

salt-cloud -d testinstance

As you can see, this makes spinning up resources using SaltStack very easy, and automatically ties these new resources into your salt-master. Now go populate your profiles, and also checkout maps to automate the deployment of many machines at once.

References

The salt-cloud documentation was crucial to putting together this article: