Cody Bunch Some Random IT Guy - OpenStack, DevOps, Cloud, Things

ZeroVM - A ZeroCloud Lab

At this point we’re pretty far down the ZeroVM rabbit hole. We’ve covered quite a bit of ground to get to this stage as well. Specific to this post, you will want to know more about ZeroCloud. You can do that here.

Regarding getting up to speed on ZeroVM as I am, you will find the following useful:

Building The ZeroCloud Lab

There are a few ways of going about this, however before we get started, realize that this is still early days and if you find this post a few months or a year or two down the road, it will likely be super out of date.

To get working with ZeroCloud, the most straight forward path is to follow the directions in the ZeroVM Docs here.

Once you’ve finished, you should have a functional ZeroCloud lab.

Experimenting in the ZeroCloud Lab

Having a lab up in running is one thing, but it’s rather boring thing by itself. So, let’s do something with it!

ZeroCloud Hello World Example

The first thing we’ll try to do, is a generic “Hello World” example, taken from here.

1. Log into the lab:

vagrant ssh

cd devstack/
source /vagrant/adminrc

zpm auth
export OS_AUTH_TOKEN=PKIZ_Zrz_Qa5NJm44FWeF7Wp...

Note: You will need to change the AUTH_TOKEN and STORAGE_URL values to match those returned by zpm auth.

2. Create our “Hello World” python file:

cat > example <<EOF
import sys
print("Hello from ZeroVM!")
print("sys.platform is '%s'" % sys.platform)

3. Now we run the example:

curl -i -X POST -H "X-Auth-Token: $OS_AUTH_TOKEN" \
  -H "X-Zerovm-Execute: 1.0" -H "Content-Type: application/python" \
  --data-binary @example $OS_STORAGE_URL

Ok, so what did we do then? In the first step we logged in to our lab, sourced a file that contains credentials for our environment, and then set some additional environment variables to store our auth token and swift url.

Next we created the hello-world example file. In the absence of a text editor we just dumped everything between “«EOF” and “EOF” into the file ‘example’. Note the first line in the file begins with #!file://. This is important as it lets the parser know what to do with said file, in this case, fire up python.

Finally, we use curl against our Swift install, letting it know to jump out to the ZeroVM middleware and that our application type is python. Additionally we specify our entire program as the payload in --data-binary


In this post, we showed you how to build a ZeroCloud lab and run an example “Hello World” application within it. If you would like to explore some more complex applications, be sure to explore the various talks and videos here.