Cloud Foundry is an open source Cloud Platform as a Service "OpenPaaS" project created by VMware. It is multi-language/framework (Java, Ruby, Node), multi-service (MongoDB, Reddis, MySQL, Postgres, RabbitMQ) and multi-cloud (public, private, micro).
Cloud Foundry BOSH is an open source tool chain for release engineering, deployment and lifecycle management of large scale distributed services. This presentation will describe the architecture, topology, configuration, and use of BOSH, as well as the structure and conventions used in packaging and deployment.
BOSH is the system VMware is using to manage CloudFoundry.com, the Cloud Foundry based service operated by VMware, on several thousand VMs, with 40+ unique node types, 75+ unique software packages, 2x/week updates and 24x7x365 non-stop operation.
BOSH is infrastructure independent, and can be used to deploy Cloud Foundry on top of Infrastructure as a Service (IaaS) products such as VMware vSphere, Amazon Web Services, or OpenStack.
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Cloud Foundry BOSH Where the Platform rubber meets the Infrastructure road - ChefConf
1. Cloud Foundry BOSH
Where the Platform rubber
meets the Infrastructure road
Patrick Chanezon with slides from Martin Englund
Senior Director Cloud Foundry Engineering
Developer Relations
chanezonp@vmware.com @pmenglund
http://twitter.com/chanezon ChefConf, San Francisco, May 2012
Wednesday, May 16, 12
2. What is Cloud Computing?
Cloud According to my daughter Eliette
2
Wednesday, May 16, 12
3. Cloud Stack - Classic Pyramid
Software
As A Service
Platform As A Service
Infrastructure As A Service
3
Wednesday, May 16, 12
4. Cloud Stack - Developer Perspective
Software
As A Service
Platform As A Service
Infrastructure
As A Service
4
Wednesday, May 16, 12
6. IaaS/Virtualization getting mainstream
§ AWS, Joyent, Rackspace,...
§ Open Source projects: OpenStack, DeltaCloud, Eucalyptus
§ Automation: Chef, Juju
§ Standardization? DMTF
§ Inside the Firewall, Virtualization: VMware, Microsoft, Xen, KVM
§ 50% of workloads are virtualized
§ Easy to provision, manage instance...BUT
§ Still need to manage backups, software stacks, monitor, upgrades
6
Wednesday, May 16, 12
7. With Infrastructure, you still need to build your own platform
§ Need to build a distributed platform on top of you infrastructure
§ Story of the AWS meltdown from last summer
• http://blog.reddit.com/2011/03/why-reddit-was-down-for-6-of-last-24.html
• http://www.readwriteweb.com/cloud/2010/12/chaos-monkey-how-netflix-
uses.php
• http://news.ycombinator.com/item?id=2477296
• http://stu.mp/2011/04/the-cloud-is-not-a-silver-bullet.html
§ Twilio, Smugmug, SimpleGeo survived it because they built their
own distributed platform on top of IaaS
§ Enterprise customers want to consider Infrastructure like CDNs
• Multi Cloud usage
• Based on Open Source de facto standards, or full standards whenever that
happens
7
Wednesday, May 16, 12
8. Platforms
Let the wild rumpus begin!
8
Wednesday, May 16, 12
9. Platforms
§ Raise the Unit of currency to be application & services instead of
infrastructure
§ Google App Engine, Cloud Foundry, SalesForce Heroku, Cloudbees,
Amazon Elastic Beanstalk, Microsoft ex-Azure, AppFog
§ Single or a few languages, services
§ Start of Multi language Polyglot platforms
§ Enabler for Agile Developers -> Create Business value faster
§ Lack of standards: risk, vendor lock-in
§ Enterprise needs:
• Control, customizability
• Private/Hybrid Cloud
• Avoid lock-in
9
Wednesday, May 16, 12
10. Main Risk: Lock-In
Welcome to the hotel california
Such a lovely place
Such a lovely face
Plenty of room at the hotel california
Any time of year, you can find it here
Last thing I remember, I was
Running for the door
I had to find the passage back
To the place I was before
’relax,’ said the night man,
We are programmed to receive.
You can checkout any time you like,
But you can never leave!
10
Wednesday, May 16, 12
11. Cloud Foundry: The Open PaaS
• Open Source: Apache 2 Licensed
• multi language/frameworks
• multi services
• multi cloud
Ap
ce
pli
vFabric
rfa
Postgres Private
ca
nte
Data
Services tio Clouds
rI
n
e
Se
Public
vid
vFabric
RabbitMQTM rvi
Cloud
ro
Msg Services
ce
dP
Micro
ou
Other
Cloud
Cl
Services
11
Wednesday, May 16, 12
13. Open Source Advantage: moves faster
§ http://code.google.com/p/googleappengine/issues/detail?id=13
• https://github.com/cloudfoundry/vcap/pull/25
13
Wednesday, May 16, 12
14. Open Source Advantage: diverse communities
§ Juju Charms to setup a multi node Cloud Foundry in 10 minutes
§ See Brian Thomason & Juan Negron’s UDS 2011 session
http://cloud.ubuntu.com/2011/09/from-zero-to-drawbridge-via-ubuntu-
server-ensemble-and-cloudfoundry-in-less-than-10-minutes/
14
Wednesday, May 16, 12
25. Chef at VMware
§ Chef is used internally in several projects at VMware
§ To manage the Cloud Foundry deployment and Life Cycle, we
developed a more specific system: BOSH
24
Wednesday, May 16, 12
26. Production Grade Cloud Foundry Clusters
§ 500 – 5,000 VMs cloudfoundry.com
§ 40+ unique node types
§ 75+ unique software packages
§ 75+ unique environments
§ 2x/week cf.com updates
§ 24x7x365 non-stop operation
§ No-downtime deployments
§ Reliable, robust, repeatable
deployments, updates, capacity
adjustments
§ Small teams manage many
instances production, staging, stress, qa, dev
Google style problem è Google style solution
25
Wednesday, May 16, 12
27. Cloud Foundry BOSH
§ Cloud Foundry BOSH is an open source tool-chain for release
engineering, deployment, and lifecycle management of large scale
distributed services
• Prescriptive way of creating releases and managing systems and services
• It is not a collection of shell scripts, not a pile of Perl
§ Built to deploy and manage production-class, large scale clusters
• Production grade Cloud Foundry clusters: 500+ VMs, 40+ jobs, 75+ packages
• Multi-node, multi-tier, complex clusters: e.g., our Gerrit/Jenkins Cluster
§ Built for devops usage and scale by a crack team of veterans
• A project, not a product: command line interface, YAML, etc.
• Continuous improvement, iterative development, rough edges
github.com/cloudfoundry/bosh
26
Wednesday, May 16, 12
28. BOSH Agenda
§ Background
§ Concepts
§ Demo
§ Workflow
§ Under the hood
27
Wednesday, May 16, 12
29. Background
§ Built from the need to operate cloudfoundry.com
• Over 40 different types of VMs
• Hundreds of running instances of VMs
• Pushing at least 2 changes per week
§ End-to-end management
• Release engineering
• Deployment
• Lifecycle management
§ Generic solution
• Any service
• Any cloud
• Any operating system
28
Wednesday, May 16, 12
30. Concepts
§ Packages
§ Jobs
§ Releases
• http://github.com/cloudfoundry/bosh-sample-release
§ Stemcells
§ Deployments
29
Wednesday, May 16, 12
31. Packages
§ Source / blobs
• Don’t commit large objects in the SCM
§ Dependencies
• Compile time dependencies
§ Versioning
• Auto-increment
§ Pre-packaging
• Preparation for compilation
§ Packaging
• Compiling the source
30
Wednesday, May 16, 12
32. Packages (nginx)
src/nginx
-rw-r--r-- 1 martin staff 25490 Apr 11 19:17 headers-more-v0.15rc1.tgz
-rw-r--r-- 1 martin staff 691501 Apr 11 19:17 nginx-1.0.11.tar.gz
-rw-r--r-- 1 martin staff 1556329 Apr 11 19:17 pcre-8.21.tar.gz
31
Wednesday, May 16, 12
34. Packages (nginx)
packages/nginx/packaging
# abort script on any command that exit with a non zero value
set -e
echo "Extracting pcre..."
tar xzf nginx/pcre-8.21.tar.gz
echo "Extracting headers-more module..."
tar xzf nginx/headers-more-v0.15rc1.tgz
echo "Extracting nginx..."
tar xzf nginx/nginx-1.0.11.tar.gz
echo "Building nginx..."
cd nginx-1.0.11
./configure
--prefix=${BOSH_INSTALL_TARGET}
--with-pcre=../pcre-8.21
--with-http_ssl_module
--add-module=../headers-more-v0.15rc1
make
make install
33
Wednesday, May 16, 12
35. Jobs
§ Packages
• Runtime dependencies
§ Templates
• Converting a generalized form to an instance specific file
§ Versioned
• Auto increments
§ Supervision
• Through monit
§ Monitoring
• Reported to the health monitor
§ Lifecycle hooks
• E.g. drain workload from job
34
Wednesday, May 16, 12
37. Jobs (nginx)
jobs/nginx/monit
check process nginx
with pidfile /var/vcap/sys/run/nginx/nginx.pid
start program "/var/vcap/jobs/nginx/bin/nginx_ctl start"
stop program "/var/vcap/jobs/nginx/bin/nginx_ctl stop"
group vcap
36
Wednesday, May 16, 12
38. Jobs (nginx)
jobs/nginx/templates/nginx.conf.erb
user root root;
worker_processes <%= properties.nginx.workers || 1 %>;
error_log /var/vcap/sys/log/nginx/nginx.error.log;
pid /var/vcap/sys/run/nginx/nginx.pid;
events {
worker_connections 8192;
use epoll;
}
...
upstream wordpress {
<% properties.wordpress.servers.each do |server| %>
server <%= server %>:<%= properties.wordpress.port %>;
<% end %>
}
server {
listen 80;
server_name "<%= properties.wordpress.servername %>";
server_name_in_redirect off;
...
37
Wednesday, May 16, 12
39. Releases
§ Packages
§ Jobs
§ Versioned
§ Self contained
§ Incremental
§ Published
» bosh create release
» bosh upload release
» bosh delete release
» bosh releases
38
Wednesday, May 16, 12
40. Stemcells
§ VM template
§ BOSH Agent
§ Versioned
§ Built using vmbuilder
§ IaaS Plugin
» bosh upload stemcell
» bosh delete stemcell
» bosh stemcells
39
Wednesday, May 16, 12
49. Dev Workflow
bosh deployment
bosh target dev
~/dev.yml
write code
run tests bosh create release
git commit bosh deploy bosh upload release
48
Wednesday, May 16, 12
50. QA Workflow
bosh deployment
bosh target qa
~/qa.yml
bug reports to dev git pull
run tests bosh create release
bosh create
release --final
bosh deploy bosh upload release
git commit
49
Wednesday, May 16, 12
51. Ops Workflow
bosh deployment
bosh target prod
~/prod.yml
bug reports to dev git pull
run tests bosh upload release
bosh deploy
done!
50
Wednesday, May 16, 12
52. Control
§ Repeatable deployments
§ Predictable rollout
51
Wednesday, May 16, 12
53. Consistency
§ Dev / Staging / Production
§ BOSH targets
52
Wednesday, May 16, 12
55. BOSH: under the hood
BOSH User
“BOSH is deployed by BOSH”
bosh cli director healthmon
cloudfoundry.com
db redis nats
workers blobs
active jobs
agent
IaaS CPI stemcell disk
54
Wednesday, May 16, 12
56. IaaS neutral by design
vSphere: battle tested implementation,
thousands of deployments CPI: code complete
vCloud Director: “work in progress”, 2H 2012 functional status: “work in progress”
Cloud Foundry BOSH
Cloud Provider Interface (CPI)
github.com/piston/openstack-bosh-
cpi
contribute: github.com/cloudfoundry/bosh
55
Wednesday, May 16, 12
58. BOSH and Chef?
§ How should they work together?
§ Talk to us on public mailing lists:
• http://groups.google.com/a/cloudfoundry.org/group/bosh-users
• http://groups.google.com/a/cloudfoundry.org/group/bosh-dev
57
Wednesday, May 16, 12
60. BOSH Community Resources
@DrNic
http://drnicwilliams.com/2012/04/16/creating-a-bosh-from-scratch-on-aws/
@BrianMMcClain
http://www.brianmmcclain.com/2012/05/08/using-bosh-with-vsphere-part-2/
https://github.com/cloudfoundry/bosh
https://groups.google.com/a/cloudfoundry.org/group/bosh-users/topics
https://github.com/piston/openstack-bosh-cpi
59
Wednesday, May 16, 12
61. Acknowledgement
§ Drawings from my daughters Eliette
§ Slides from Mark Lucovsky, Dave McCrory, Derek Collison, Martin
Englund
60
Wednesday, May 16, 12