2. Setting up a development environment

The easiest way to get up and running is to install and run ZeroCloud on DevStack inside VirtualBox. We provide some Vagrant scripts to make the setup require little effort.

With this environment, you can not only write and run applications on ZeroCloud, but you can also hack on ZeroCloud on itself.

Note to Linux users: There should be packages available (using the favored package manager of your distro) for just about everything you need to install.

2.1. Install VirtualBox

Download and install VirtualBox: https://www.virtualbox.org/wiki/Downloads.

2.2. Install Vagrant

Download and install Vagrant: https://www.vagrantup.com/downloads.html.

2.3. Clone the ZeroCloud source code

First, you’ll need to download and install Git: http://git-scm.com/downloads

From a command line, clone the soure code. In this example, we just checkout the code into a zerocloud folder in our home directory.

$ git clone https://github.com/zerovm/zerocloud.git $HOME/zerocloud

2.4. vagrant up

Now we can actually start OpenStack Swift and ZeroCloud, inside a VM:

$ cd $HOME/zerocloud/contrib/vagrant
$ vagrant up

vagrant up will download and install DevStack and configure it to run Swift with the ZeroCloud middleware. This usually takes about 10-15 minutes.

2.5. Install and configure command line clients

To interact with and test your ZeroCloud deployment, you’ll need to install a handful of tools. You can install all of these tools from PyPI using pip on your Vagrant/Virtual Box VM.

$ sudo pip install python-swiftclient python-keystoneclient zpm


zpm (ZeroVM Package Manager) is a tool which make it easier to develop, package, and deploy applications for ZeroCloud.

To authenticate with your ZeroCloud installation, you’ll need to set up your credentials in some environment variables. A configuration file is provided for convenience in $HOME/zerocloud/contrib/vagrant.

$ source /vagrant/adminrc

You can test your client configuration by running zpm auth:

$ zpm auth
Auth token: PKIZ_Zrz_Qa5NJm44FWeF7Wp...
Storage URL:

If you see output that looks like this, everything should be in order.

Setting a couple of environment variables with these values will make commands more concise and convenient to execute:

$ export OS_AUTH_TOKEN=PKIZ_Zrz_Qa5NJm44FWeF7Wp...
$ export OS_STORAGE_URL=
$ export OS_STORAGE_ACCOUNT=AUTH_7fbcd8784f8843a180cf187bbb12e49c

2.6. Restarting DevStack

If you ever need to kill/restart DevStack (as is the case if you modify ZeroCloud code or change Swift configuration settings), first log in to the vagrant box:

$ vagrant ssh

Next, we need to terminate all of the DevStack processes. The first time you do this, you need to use a little brute force. First, run rejoin-stack.sh:

$ cd $HOME/devstack
$ ./rejoin-stack.sh

This will put you into a screen session. To terminate DevStack, press ‘ctrl+a backslash’, then ‘y’ to confirm. NOTE: The first time you restart DevStack after provisioning the machine, not all of the Swift processes will be killed. A little brute force is needed:

$ ps ax | grep [s]wift | awk '{print $1}' | xargs kill

Now restart DevStack:

$ cd $HOME/devstack
$ ./rejoin-stack.sh

Subsequent restarts are easier. Run ./rejoin-stack.sh as above, press ‘ctrl+a backslash’, ‘y’ to confirm, then run ./rejoin-stack.sh again.

To log out of the vagrant box and keep everything running, press ‘ctrl+a d’ to detach from the screen session. You can now log out of the box (‘ctrl+d’).