- Ubuntu 12.04 64bit server with 16GB RAM
eth0
- The interface that has a public IP address
- 192.168.10.10/24
- The network that your server belongs to
- 192.168.10.2
- The IP address of your server
The OpenStack team provides an easy installer named DevStack that builds an OpenStack instance on a single server.
sudo apt-get install git
git clone git://github.com/openstack-dev/devstack.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'
DATABASE_PASSWORD=openstack
RABBIT_PASSWORD=openstack
SERVICE_TOKEN=openstack
SERVICE_PASSWORD=openstack
ADMIN_PASSWORD=openstack
# Allow larger Ephemeral disks
VOLUME_BACKING_FILE_SIZE=70000M
# Allow faster API calls
API_RATE_LIMIT=False
# NIC connected to your network
PUBLIC_INTERFACE=eth0
# Public IP addresses to be bound to edge VMs such as routers and MicroBOSH.
# (Other VMs use the default private (10.0.0.0/24) network)
# At least 2 public IP addresses are qureied.
# 192.168.10.128 - 192.168.10.255
FLOATING_RANGE=192.168.10.128/25
# Your server IP address
HOST_IP=192.168.10.2
_EOF_
- 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.
Run the command below:
./stack.sh
Open http://192.168.10.2
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.
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_TENANT_NAME=BOSH
export OS_AUTH_URL=http://192.168.10.2:5000/v2.0/ # 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
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 https://github.com/cloudfoundry-community/bosh-bootstrap.git
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: http://192.168.10.2:5000/v2.0
...
A full BOSH system requires too much resources, so we skip deploying it.
TODO: detailed instruction
You can use Dr. Nic's sample manifest.
Open the OpenStack console and configure the BOSH
project for your CF instance.
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.
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.
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.
As usual, clone the cf-release repository and create a release.
gem install bosh_cli
cd ~
git clone https://github.com/cloudfoundry/cf-release.git
cd cf-release
./update
bosh create release --force
cd ~
mkdir stemcells
cd stemcells
wget http://bosh-jenkins-artifacts.s3.amazonaws.com/last_successful_bosh-stemcell-openstack.tgz
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
./unstack.sh
and reboot the server.
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.