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!
Vagrant is a tool that allows you to build a complete development environment quickly and easily. If you’re a developer using Vagrant, you can use the Rackspace Cloud as a provider and test your provisioning on the same platform you use for production. It’s really easy to get started. Assuming you have Vagrant installed already all you need is a plugin:
$ vagrant plugin install vagrant-rackspace
Then add the dummy box:
$ vagrant box add dummy https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box
And finally, add the Rackspace parts to your Vagrantfile:
Vagrant.configure("2") do |config| config.vm.box = "dummy" config.vm.provider :rackspace do |rs| rs.username = "YOUR USERNAME" rs.api_key = "YOUR API KEY" rs.flavor = /512MB/ rs.image = /Ubuntu/ end end
When you are ready to build a Cloud Server, just run:
$ vagrant up --provider=rackspace
That’s it! You can use Vagrant to test your configuration management, new application features, and get rid of that pesky “It works on my machine!” problem. Check back tomorrow for more tips and tricks!