Cloud Foundry Documentation
|
We are in a time of transition:
|
Deploying to vCloud Director Using Cloud Foundry BOSH
In this tutorial we learn how to deploy a simple Wordpress application on vCloud Director using BOSH.
Prerequisites
To get started with BOSH on vCloud you need:
- An account in a vCloud organization with organization administrator credentials
- A vCloud virtual datacenter with an Internet routable network and a block of assigned IP addresses
- A Mac or *NIX computer
- The BOSH CLI
Installing the BOSH Deployer
We assume you already have Ruby (1.9.2) and rubygems (1.8) installed. To install the BOSH deployer gem (which includes the BOSH CLI):
gem install bosh_deployer
Micro BOSH Stemcells
- We have published micro BOSH stemcells for download. When you are ready to use the BOSH deployer download a micro BOSH stemcell.
Download a micro BOSH stemcell with version >= 0.8.0 (coming soon) Use bosh-release version #11 or higher.
Note : Stemcells for vSphere work for vCloud Director
% bosh public stemcells
+---------------------------------------+--------------------------------------------------+
| Name | Tags |
+---------------------------------------+--------------------------------------------------+
| bosh-stemcell-aws-0.6.4.tgz | aws, stable |
| bosh-stemcell-vsphere-0.6.4.tgz | vsphere, stable |
| bosh-stemcell-vsphere-0.6.7.tgz | vsphere, stable |
| micro-bosh-stemcell-aws-0.6.4.tgz | aws, micro, stable |
| micro-bosh-stemcell-vsphere-0.6.4.tgz | vsphere, micro, stable |
+---------------------------------------+--------------------------------------------------+
To download use bosh download public stemcell <stemcell_name> as shown below
% bosh download public stemcell micro-bosh-stemcell-0.8.0.tgz
Deploying Micro BOSH
To deploy Micro Bosh on vCloud you will need to prepare resources from the cloud infrastructure managed by vCloud for use by BOSH.
Preparing vCloud virtual data center resources
- Add a catalog where stemcells and media (ISOs) for BOSH will be stored.

- Add a network to the virtual datacenter. Configure the network to be directly connected to the virtual datacenter external network. Steps to Create an External Direct Organization vDC Network.
Create the Directory Structure
The BOSH deployer will deploy applications based on files in expected directory locations:
mkdir ~/deployments
cd ~/deployments
mkdir vcloud
Create Micro BOSH Config File
Micro BOSH configurations are set in the micro_bosh.yml, which you need to create.
- Create
~/deployments/vcloud/micro_bosh.ymlusing this template.
- Update the instance of
x.x.x.xwith one of the IPs from the block assigned to you. Change the other IP addressesn.n.n.nto match your network’s netmask, gateway, DNS and NTP server addresses. - Under the vcds section, replace
v.v.v.vwith the address of the vCloud instance and enter your vCloud credentials. - Save the file
Deploying Micro BOSH
Micro BOSH can now be deployed from your deployments directory.
Make sure you are in your deployments directory:
cd ~/deployments
Select the deployment you created:
bosh micro deployment vcloud
Note: don’t be concerned by seemingly inaccurate message WARNING! Your target has been changed to http://vcloud:25555!
Start the deployment using the micro stemcell downloaded earlier:
bosh micro deploy ~/stemcells/micro-bosh-stemcell-vsphere-0.8.0.tgz
Within 20 minutes your instance of micro BOSH will be deployed. After the ‘Done’ message appears, you have a running micro BOSH instance.
If your deployment failed for some reason use the following to clean up:
bosh micro delete
Log in to the Micro BOSH:
bosh login
Type the default account name is admin and the password is admin
Change the account name and password using the command below. Don’t say we didn’t tell you if someone deletes your deployment!
bosh create user <username> <password>
Deploying an Application Using BOSH
We have created a sample three-tier application (Nginx, Apache + PHP with WordPress, and MySQL) to demonstrate how you can use BOSH, and the next step is to deploy it using your newly created micro BOSH instance.
Uploading the Sample Release
The sample release is on Github for your cloning convenience:
First make a git clone of the sample application release repository:
cd ~ git clone git://github.com/cloudfoundry/bosh-sample-release.git cd bosh-sample-release
Upload the release to micro BOSH:
bosh upload releases/wordpress-1.yml
Uploading the Latest Stem Cell
Now we download the latest stem cellto upload to our micro BOSH instance.
Download the latest BOSH stem cell for vCloud:
bosh download public stemcell bosh-stemcell-vsphere-0.6.7.tgz
Upload it to your micro BOSH instance:
bosh upload stemcell bosh-stemcell-vsphere-0.6.7.tgz
Create a Private Network
Add private networks to separate application components from each other and from direct access by users. Here, “cf-net” is a direct network added earlier and “cf-routed” is a private network.

To allow machines on the private network to talk outside the network, e.g. the micro BOSH, configure a source NAT rule on the network.

Create a Deployment Manifest
Get the director UUID using the following command:
bosh status
Copy the file wordpress-vcloud.yml in the bosh-sample-release directory and update it to suit your network.
Deploy
Select the deployment manifest you just created:
bosh deployment ~/wordpress-vcloud.yml
Initiate the deployment:
bosh deploy
Sit back and enjoy the show!
Connect to the deployed sample application
Once your deployment is complete point your browser to the IP of the vm where nginx job is running http://<nginx-vm-staticip>.
Congratulations. You just used BOSH to deploy an application to vCloud!