Create a gist now

Instantly share code, notes, and snippets.


How to deploy CFv2 with OpenStack and BOSH on a single machine



  • Ubuntu 12.04 64bit server with 16GB RAM

Variables in This Document

  • eth0
    • The interface that has a public IP address
    • The network that your server belongs to
    • The IP address of your server

Installing OpenStack (DevStack)

The OpenStack team provides an easy installer named DevStack that builds an OpenStack instance on a single server.

Cloning the Repository and Checking out the stable branch

sudo apt-get install git
git clone git://
cd devstack

# Using Grizlly
git checkout -t origin/stable/grizzly


You need some configuration to build a DevStack instance. The configuration file name is localrc.

(Modify the netowrk settings according to your own environemnent)

cat <<_EOF_ > localrc
# All passwords are 'openstack'

# Allow larger Ephemeral disks
# Allow faster API calls

# NIC connected to your network
# Public IP addresses to be bound to edge VMs such as routers and MicroBOSH.
# (Other VMs use the default private ( network)
# At least 2 public IP addresses are qureied.
# -
# Your server IP address


  • Quantum (advanced network manager) is not required on this document.
  • When you change the value of VOLUME_BACKING_FILE_SIZE in the localrc, delete /opt/stack/data/stack-volumes-backing-file to apply the change.

Running the installer script

Run the command below:


Creating a User and Project for BOSH

Open on your web browser. You will see the login page of the OpenStack console which is called Horizon. You can login to the console with the ID admin and the password openstack. Choose the Admin tab on the left menu and move to Users page. You can create users on this page. Click the "+ Create User" button on the upper left of the page and fill out the form. In this instruction, we use bosh_admin for the user name and c1oudc0w for the password. In the form, you can create a Project (sometimes also called Tenant) at the same time. Click the "+" button on the Project field and create a project named BOSH. And then, choose Admin at the Role filed.

Create Flavors for BOSH VMs

If you are an AWS user, you are familiar with flavors. Flavars on OpenStack are types of VM spec such as m1.micro, m1.medium and m1.large on the EC2. You need to create some flavors used later by bosh-bootstrap.

Before createing flavaors, you need to export some environemnt variables to connect to your devstack instance. Of course, you can write these commands to your .profle file.

export OS_USERNAME=bosh_admin
export OS_PASSWORD=c1oudc0w
export OS_AUTH_URL= # found at 'Access & Securit' -> 'API Access'

And then, delete existing default flavors once for simplicity.

nova flavor-list | grep m1 | awk '{ print $4 }' | xargs -n 1 nova flavor-delete

Finally, create three flavors.

nova flavor-create m1.small 2 2048 20 1 --ephemeral 20 --rxtx-factor 1 --is-public true
nova flavor-create m1.medium 3 4096 20 2 --ephemeral 20 --rxtx-factor 1 --is-public true
nova flavor-create m1.microbosh 20 4096 20 2 --ephemeral 20 --rxtx-factor 1 --is-public true

Deploying a MicroBOSH with bosh-bootstrap

To bootstarap a BOSH system, we need to deploy a MicroBOSH first. MicroBOSH is a single VM that has all BOSH components. You can use bosh-bootstrap developed by Dr. NIC to deploy a MicroBOSH VM to your DevStack instance. bosh-bootstrap automatically setup SSH keypairs, secrity groups and other misc settings.

# Cloning the lateset source code from Github
git clone
cd bosh-bootstrap
bundle install
bundle exec ./bin/bosh-bootstrap deploy
# Then you will be asked some questions:
1. AWS
2. OpenStack
Choose your infrastructure: 2

Using provider OpenStack

Username: bosh_admin
Password: c1oudc0w
Tenant: BOSH
Authorization Token URL:

Deploying a Full BOSH, Not

A full BOSH system requires too much resources, so we skip deploying it.

Deploying the CF instance

Writing a Manifest for the CF Instance

TODO: detailed instruction

You can use Dr. Nic's sample manifest.

Configuring the Project for the CF Instance

Open the OpenStack console and configure the BOSH project for your CF instance.

Making RAM Space larger

The default memory quota is too small for a CF system. Set 9999999 to the RAM (MB) field in the form of Modify Quota box in the Project page.

Provisioning a Public Floating IP Address

You need to manually create a Floating IP Address for your router VM. Go to the Floating IPs page via the Access & Security tab in the left menu and create a Floating IP Address.

Creating a Security Group

TODO) Minumum port range

To open ports which are used by CF components, create a security group named cf. Then create a rule that opens ports from 1 to 65533.

Preparing cf-release

As usual, clone the cf-release repository and create a release.

gem install bosh_cli

cd ~
git clone
cd cf-release
bosh create release --force

Downloading the latest stemcell

cd ~
mkdir stemcells
cd stemcells

Deploying the CF instance

Good luck!

bosh upload release ~/cf-release/dev_releases/appcloud-131.1-dev.yml
bboh upload stemcell ~/stemcells/last_successful_bosh-stemcell-openstack.tgz
bosh deployment manifest.yml
bosh deploy

Trouble Shooting

Something wrong with DevStack

./ and reboot the server.

Something wring with MicroBOSH

bundle exec ./bin/bosh-bootstrap delete and remove config files with rm -rf ~/.microbosh/settings.yml && rm -rf ~/.microbosh/deployments/bosh* and then re-deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment