• Contact Us
  • Using Cloud Foundry
  • Running Cloud Foundry
  • Get Involved
  • Using Cloud Foundry
    Application Architecture Considerations
    Deploying Apps
    Managing Apps
    Using Services
    See all
    Running Cloud Foundry
    Architecture
    BOSH
    Deploying with BOSH
    Deploying with Chef
    Micro Cloud Foundry
    Managing Cloud Foundry
    See all
    Reference
    Cloud Foundry REST API
    CloudFoundry.com
    Technical Integration
    Community
Fork me on GitHub

Cloud Foundry Documentation

  • Home
  • Running Cloud Foundry
  • Deploying Cloud Foundry with BOSH
  • Deploying Cloud Foundry on vCloud Director

We are in a time of transition:
  • You are reading V2 documentation. The V1 docs are available here.
  • You can browse http://api.{cloudfoundry url}/info to check a Cloud Foundry version.
  • The CF command-line is for Cloud Foundry V2. Use VMC for Cloud Foundry V1.
  • 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:

    1. An account in a vCloud organization with organization administrator credentials
    2. A vCloud virtual datacenter with an Internet routable network and a block of assigned IP addresses
    3. A Mac or *NIX computer
    4. 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.

    vcloud_catalog

    • 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.yml using this template.
    1. Update the instance of x.x.x.x with one of the IPs from the block assigned to you. Change the other IP addresses n.n.n.n to match your network’s netmask, gateway, DNS and NTP server addresses.
    2. Under the vcds section, replace v.v.v.v with the address of the vCloud instance and enter your vCloud credentials.
    3. 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

    1. 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. vcloud_private_network

    2. 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.

      vcloud_source_nat

    Create a Deployment Manifest

    1. Get the director UUID using the following command:

      bosh status
      
    2. Copy the file wordpress-vcloud.yml in the bosh-sample-release directory and update it to suit your network.

    Deploy

    1. Select the deployment manifest you just created:

      bosh deployment ~/wordpress-vcloud.yml
      
    2. Initiate the deployment:

      bosh deploy
      
    3. 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!

    • Twitter
    • Google+
    • Facebook
    • Youtube
    • About
    • •
    • Blog
    • •
    • Partners
    • •
    • Forums
    • •
    • Status
    • •
    • Contact
    Using Cloud Foundry Application Architecture
    Deploying Apps
    Managing Apps
    Using Services
    Running Cloud Foundry Architecture
    BOSH
    Deploying with BOSH
    Deploying with Chef
    Micro Cloud Foundry
    Managing Cloud Foundry
    Developer Community
    Get Involved
    Contribute
    Source Code
    Mailing Lists
    Report Issues
    Documentation
    Using Cloud Foundry
    Running Cloud Foundry
    Reference
    Community
    Cloud Foundry
    Events
    Calendar
    Webinars
    FAQ
    Jobs

    © GoPivotal, Inc. All rights reserved. Terms Legal Privacy