Deploying Cloud Foundry with BOSH Lite v2

Preparing to Deploy Cloud Foundry

Note: - This guide requires you to be logged in to your Director, and the rest of the instructions assume you have already done so.

Next we need to obtain a manifest. In this exercise we’ll use the ‘canonical’ manifest provided by the Cloud Foundry Foundation. Among other uses, the file lists the different releases that BOSH will download when you make your deployment.

git clone ~/workspace/cf-deployment

cd ~/workspace/cf-deployment
git checkout tags/v1.15.0

Check to see if you’ve already set $BOSH_ENVIRONMENT:


If you see an empty output, set the BOSH_ENVIRONMENT environment variable to your Director’s external IP. Your Director IP will be if you followed the guide to run BOSH Lite v2 locally:

export BOSH_ENVIRONMENT=<your environment IP/name>

Run the following command to update the cloud-config. This file is used to translate deployment manifests, which describe cloud resources in a generic way, into configuration specific to the IaaS provider where the deployment is being made.

bosh update-cloud-config ~/workspace/cf-deployment/iaas-support/bosh-lite/cloud-config.yml

The last step before deploying is to upload a stemcell - the base operating system for every VM in the deployment. You need to ensure you upload a stemcell that matches the version expected by the manifest cf-deployment.yml, which we can achieve by pulling the value out of the file:

export STEMCELL_VERSION=$(bosh int cf-deployment.yml --path '/stemcells/alias=default/version')

bosh upload-stemcell "$STEMCELL_VERSION"

Checking Your Work

  bosh stemcells

You should see something like this:

Name                                         Version   OS             CPI  CID
bosh-warden-boshlite-ubuntu-trusty-go_agent  3468.21*  ubuntu-trusty  -    765798f4-756f-4ba7-52d4-26e64a5bf0cc

(*) Currently deployed

1 stemcells

Deploy CF

If have you deployed BOSH Lite v2 locally, set $SYSTEM_DOMAIN to If you deployed BOSH Lite v2 to AWS, use $

There’s just one more command to set your deployment running:

bosh -d cf deploy ~/workspace/cf-deployment/cf-deployment.yml \
-o ~/workspace/cf-deployment/operations/bosh-lite.yml \
-o ~/workspace/cf-deployment/operations/use-compiled-releases.yml \
--vars-store deployment-vars.yml \
-v system_domain=$SYSTEM_DOMAIN

Note: This deployment will take a while (~20-30 minutes). However there will be a confirmation prompt near the beginning so keep an eye on your screen.

In our example, cf is the name we’re choosing to give the deployment. cf-deployment.yml is our Cloud Foundry deployment manifest, while bosh-lite.yml and use-compiled-releases.yml are ‘operations’ files which make changes to that manifest. The ‘vars-store’ flag specifies where we want BOSH to generate a file containing credentials for our deployment. Lastly, ‘system domain’ will be used as the root domain for your deployment.

Checking Your Work

You can view a list of your deployments by running:

  bosh deployments

Barring any hitches, the output should look something like this, and will include details of the many BOSH releases that make up a Cloud Foundry deployment:

Name  Release(s)                   Stemcell(s)                                          Team(s)  Cloud Config
cf    binary-buildpack/1.0.15      bosh-warden-boshlite-ubuntu-trusty-go_agent/3468.21  -        latest

1 deployments

Congratulations, you have just BOSH-deployed your first Cloud Foundry instance!

Checking your manifest

After you’ve made a deployment, it can sometimes be useful to be able to check the exact version of the manifest BOSH used when standing it up. You could check the copy of the manifest you have locally (in our case, cf-deployment.yml), but it’s likely that in this version a number of variables will be undefined. For example:

- name: blobstore
    release: capi
      system_domain: "((system_domain))"

If instead you run bosh manifest -d <deployment-name>, you’ll see the complete manifest:

- name: blobstore
    release: capi

Beyond the class

bosh help
bosh tasks
bosh tasks --recent
bosh task <id> --debug
bosh vms
© 2019 Copyright Cloud Foundry Foundation. All Rights Reserved.