cf intro for spring devs

57
Introduction to Cloud Foundry for Spring & Java Developers Eric BOTTARD Developer Advocate @ebottard / [email protected]

Upload: eric-bottard

Post on 10-May-2015

753 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cf intro for spring devs

Introduction to Cloud Foundryfor Spring amp Java Developers

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

CONFIDENTIAL

2

Deploy and scale applications in seconds without locking yourself into a

single cloud

The Open Platform as a Service

CONFIDENTIAL

Eric BOTTARD

sect Developer Advocate at VMware

sect ebottard

sect ebottardvmwarecom

3

CONFIDENTIAL

Agenda

4

sect What is Platform as a Service

sect Introducing Cloud Foundry

sect The benefits of being Open

sect Avoiding Vendor Lock-in

sect Demos

sect Under the Hood

sect Spring makes it Easy

sect Cloud Foundry BOSH

Platform as a Service

5

6

ldquoI just want to deploy my codehelliprdquo

7

What ifhellip

13 target13 ltany13 cloudgt13 13 push13 ltmy13 appgt

13 bind13 ltmy13 servicesgt

13 instances13 ltmy13 appgt13 +10013

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 2: Cf intro for spring devs

CONFIDENTIAL

2

Deploy and scale applications in seconds without locking yourself into a

single cloud

The Open Platform as a Service

CONFIDENTIAL

Eric BOTTARD

sect Developer Advocate at VMware

sect ebottard

sect ebottardvmwarecom

3

CONFIDENTIAL

Agenda

4

sect What is Platform as a Service

sect Introducing Cloud Foundry

sect The benefits of being Open

sect Avoiding Vendor Lock-in

sect Demos

sect Under the Hood

sect Spring makes it Easy

sect Cloud Foundry BOSH

Platform as a Service

5

6

ldquoI just want to deploy my codehelliprdquo

7

What ifhellip

13 target13 ltany13 cloudgt13 13 push13 ltmy13 appgt

13 bind13 ltmy13 servicesgt

13 instances13 ltmy13 appgt13 +10013

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 3: Cf intro for spring devs

CONFIDENTIAL

Eric BOTTARD

sect Developer Advocate at VMware

sect ebottard

sect ebottardvmwarecom

3

CONFIDENTIAL

Agenda

4

sect What is Platform as a Service

sect Introducing Cloud Foundry

sect The benefits of being Open

sect Avoiding Vendor Lock-in

sect Demos

sect Under the Hood

sect Spring makes it Easy

sect Cloud Foundry BOSH

Platform as a Service

5

6

ldquoI just want to deploy my codehelliprdquo

7

What ifhellip

13 target13 ltany13 cloudgt13 13 push13 ltmy13 appgt

13 bind13 ltmy13 servicesgt

13 instances13 ltmy13 appgt13 +10013

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 4: Cf intro for spring devs

CONFIDENTIAL

Agenda

4

sect What is Platform as a Service

sect Introducing Cloud Foundry

sect The benefits of being Open

sect Avoiding Vendor Lock-in

sect Demos

sect Under the Hood

sect Spring makes it Easy

sect Cloud Foundry BOSH

Platform as a Service

5

6

ldquoI just want to deploy my codehelliprdquo

7

What ifhellip

13 target13 ltany13 cloudgt13 13 push13 ltmy13 appgt

13 bind13 ltmy13 servicesgt

13 instances13 ltmy13 appgt13 +10013

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 5: Cf intro for spring devs

Platform as a Service

5

6

ldquoI just want to deploy my codehelliprdquo

7

What ifhellip

13 target13 ltany13 cloudgt13 13 push13 ltmy13 appgt

13 bind13 ltmy13 servicesgt

13 instances13 ltmy13 appgt13 +10013

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 6: Cf intro for spring devs

6

ldquoI just want to deploy my codehelliprdquo

7

What ifhellip

13 target13 ltany13 cloudgt13 13 push13 ltmy13 appgt

13 bind13 ltmy13 servicesgt

13 instances13 ltmy13 appgt13 +10013

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 7: Cf intro for spring devs

7

What ifhellip

13 target13 ltany13 cloudgt13 13 push13 ltmy13 appgt

13 bind13 ltmy13 servicesgt

13 instances13 ltmy13 appgt13 +10013

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 8: Cf intro for spring devs

CONFIDENTIAL

8

Whatrsquos Happening with Applications Todaysect Frameworks are what really matter

bull Developer productivity and innovation

bull Reduce time to market

sect New application typesbull Mobile Social SaaS

bull Apps released early and often

sect Data intensivebull Emerging requirements elasticity multi-cloud

bull Web orientation drives exponential data volumes

sect Deployed on virtual and cloud infrastructuresbull Virtualization Cloud PaaS

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 9: Cf intro for spring devs

Do your current apps look like this

9

Tomcat

MySQLBrowser Apachewar

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 10: Cf intro for spring devs

Chances are they will soon look like this

10

MySQL

DesktopBrowser

Tomcat

userswar

Tomcat

searchwar

Tomcat

orderswar

MongoNativeMobile

App

HTML5 Mobile

App

NodejsFront End

Message Buseg RabbitMQ

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 11: Cf intro for spring devs

Cloud Stack - Classic Pyramid

11

Softwareas a Service

Platform as a Service

Infrastructure as a Service

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 12: Cf intro for spring devs

Cloud Stack - By Value

12

Softwareas a Service

Platform as a Service

Infrastructureas a Service

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 13: Cf intro for spring devs

Introducing

13

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 14: Cf intro for spring devs

CONFIDENTIAL

14

Cloud Foundry ndash The Open Platform as a Service

Target a choice of deployment clouds

Provide a choice of development frameworks

Bind a choice of application

services

githubcomcloudfoundry

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 15: Cf intro for spring devs

CONFIDENTIAL

15

Why Cloud FoundryDeveloper Agility

bull Friction-free way to develop test and deploy applications

bull Focus on writing applications not meddling with middleware and infrastructure

Portability without changes bull Write once test-scale-deploy to privatepublic clouds without code changes

bull Quickly build and test on a laptop and scale to the cloud

Open - The freedom to choose bull Choice of clouds for deployment industry frameworks and application services

bull Extensible architecture to ldquofuture proofrdquo for rapid cloud innovation

bull Community open-source project - access evaluate and contribute

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 16: Cf intro for spring devs

16

CloudFoundryCOM ndash Multi-Tenant PaaS Operated by VMware

Frameworks

Services

vCenter vSphere

CloudFoundryCOM (beta)

Infrastructure

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 17: Cf intro for spring devs

CONFIDENTIAL

17

Micro Cloud FoundryTM ndash Cloud on a Stick

Single VM instance of Cloud Foundry that runs on a developerrsquos MAC or PC

Frameworks

Services

Micro Cloud Foundry

Your LaptopPC

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 18: Cf intro for spring devs

The Benefits of Being

18

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 19: Cf intro for spring devs

CONFIDENTIAL

19

CloudFoundryORG ndash Community Open Source Project

githubcomcloudfoundry

sect NET x 2

sect PHP

sect JRuby

sect Python

sect Rails 2x

sect Clojure

sect Erlang

sect Haskell

sect Memcached

sect SQL Server

sect Neo4j

sect CouchDB

sect VirtualBox

sect Mono

sect Rack

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 20: Cf intro for spring devs

CONFIDENTIAL

20

CloudFoundryORG ndash Community Open Source Project

DownloadCode

Setup Environment

Deploy Behind Firewall

Tool Chain ampScripts

Apache2 license

Your Infrastructure

Cloud Foundry BOSH

CloudFoundryORG

Community Frameworks Contributions

Community Services Contributions

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 21: Cf intro for spring devs

CONFIDENTIAL21

Cloud Foundry Open Source Workflow

Reviewers +2-2

test verification score git push triggers test execution

Gerrit Code Review

reviewscloudfoundryorg

Jenkins CI

cicloudfoundryorg

github

githubcomcloudfoundry

+1-1 Committers

on +2 and change pushed to github

cloudfoundrycom

production updated ~2xweek

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 22: Cf intro for spring devs

CONFIDENTIAL

Open Source Advantage more features

22

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 23: Cf intro for spring devs

CONFIDENTIAL

Open Source Advantage more features

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 24: Cf intro for spring devs

CONFIDENTIAL

Open Source Advantage more innovation

24

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 25: Cf intro for spring devs

CONFIDENTIAL

Open Source Advantage more innovation

25

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 26: Cf intro for spring devs

Avoiding Vendor Lock-In

26

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 27: Cf intro for spring devs

CONFIDENTIAL

27

MicroClouds

PrivateClouds

PublicClouds

Multi-Cloud Flexibility is Criticalsect Make use of both public and private clouds without rewriting your

applications

sect Protect against vendor lock-in

sect Meet different compliance and geographical needs

sect Manage your growth accommodate peak loads amp optimize costs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 28: Cf intro for spring devs

CONFIDENTIAL

Main Risk Lock In

28

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

rsquorelaxrsquo said the night man

We are programmed to receive

You can checkout any time you like

But you can never leave

-the Eagles

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 29: Cf intro for spring devs

CONFIDENTIAL

29

Broad Industry Investment

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 30: Cf intro for spring devs

CONFIDENTIAL

30

Cloud Foundry - Making Multi-Cloud a Reality

Public Cloud Operators

COM

Management and Deployment

Private Cloud Distributions

Bare metal

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 31: Cf intro for spring devs

CONFIDENTIAL

Cloud Foundry Clouds

31

sect Joyent

bull community lead for Nodejs

sect ActiveState

bull community lead for Python Perl

bull Providers of Stackato private PaaS

sect AppFogcom

bull community lead for PHP

bull PaaS for PHP

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 32: Cf intro for spring devs

Demos

32

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 33: Cf intro for spring devs

Under the Hood

33

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 34: Cf intro for spring devs

CONFIDENTIAL

Cloud Foundry Logical View

Routers

CloudControllers App

Services

App

HealthManagerExecution Agents

(DEA) Pool

Messaging

UsersDevelopersvmc

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 35: Cf intro for spring devs

ldquoThe Twelve Factor App httpwww12factornet

Environment Variables [] unlike custom config files or other config mechanisms such as Java System Properties are a language- and OS-agnostic standard

35

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 36: Cf intro for spring devs

VCAP_

VCAP_APP_HOST = 192168113

VCAP_APP_PORT = 58121

VCAP_SERVICES = redis-22 [ name my-redis-service label redis-22 plan free tags [ key-value nosql redis-22 redis ] credentials hostname 127001 host 127001 port 5000 password ce7b483f-66d1-436d-8aa7-7c33a9ee31ac name e740add8-24ce-40f5-94ed-8a2623e0be57 ] postgresql-90 []

36

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 37: Cf intro for spring devs

So you could

Use SystemgetEnv(ldquoVCAP_SERVICESrdquo)

but itrsquos better to

ltdependencygt ltgroupIdgtorgcloudfoundryltgroupIdgt ltartifactIdgtcloudfoundry-runtimeltartifactIdgt ltversiongt082ltversiongtltdependencygt

37

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 38: Cf intro for spring devs

CloudEnvironment amp Friends

Gives access to the VCAP_ variablesCloudEnvironment env = new CloudEnvironment()if (envisCloudFoundry()) Parses and retrieves info about the service named mydb RdbmsServiceInfo info = envgetServiceInfo(mydb RdbmsServiceInfoclass) From there you can either infogetHost() infogetPort() or create a DataSource with the given info RdbmsServiceCreator creator = new RdbmsServiceCreator() DataSource ds = creatorcreateService(info)

38

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 39: Cf intro for spring devs

Spring Makes it Easy

39

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 40: Cf intro for spring devs

Spring your local config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

40

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 41: Cf intro for spring devs

Spring Cloud Foundry config

41

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 42: Cf intro for spring devs

Spring Cloud Foundry config

ltbean id=dataSource class=orgapachecommonsdbcpBasicDataSource destroy-method=closegt ltproperty name=driverClassName value=commysqljdbcDriver gt ltproperty name=url value=jdbcmysqllocalhost3306mydb gt ltproperty name=username value=myuser gt ltproperty name=password value=s3cr3t gtltbeangt

ltbean id=entityManagerFactory class=orgspringframeworkormjpaLocalContainerEntityManagerFactoryBeangt ltproperty name=dataSource ref=dataSource gt ltproperty name=persistenceUnitName value=myPersistenceUnit gt ltproperty name=jpaVendorAdaptergt ltbean class=orgspringframeworkormjpavendorHibernateJpaVendorAdaptergt ltproperty name=databasePlatform value=orghibernatedialectMySQLDialect gt ltbeangt ltpropertygtltbeangt

41

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 43: Cf intro for spring devs

CONFIDENTIAL

Auto-reconfigurationsectWorks for Spring Node RubysectSpring Uses a BeanFactoryPostProcessor

under the hoodbulladds a jar to your appbullmodifies webxml to load the BFPPbullalso adds correct jdbc driver jar

sectOnly works if no ambiguity (80 of apps)bull One service of a kind

42

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 44: Cf intro for spring devs

CONFIDENTIAL

Introducing the ltcloudxgt namespacesect For the remaining 20 of apps

bull if your app uses eg 2 DataSources

bull or if you want more control

43

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 45: Cf intro for spring devs

CONFIDENTIAL

ltcloudservice-scan gtsect Scans all bound services and creates a bean for each

sect Use Qualifier to disambiguate

44

Inject Qualifier(mysql-source) private DataSource sourceDS Inject Qualifier(mysql-destination) private DataSource destDS

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 46: Cf intro for spring devs

CONFIDENTIAL

Explicit service listing

45

ltclouddata-source id=beanId service-name=mysql-dbgt ltcloudconnection properties=gt ltcloudpool pool-size= max-wait-time=gtltclouddata-sourcegt

ltcloudmongo-db-factory id= service-name= write-concern=NONEgt ltcloudmongo-options connections-per-host= max-wait-time=gtltcloudmongo-db-factorygt

ltcloudrabbit-connection-factory id= service-name=gt ltcloudrabbit-options channel-cache-size=gtltcloudrabbit-connection-factorygt

ltcloudredis-connection-factory id= service-name=gt ltcloudpool pool-size= max-wait-time=gtltcloudredis-connection-factorygt

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 47: Cf intro for spring devs

CONFIDENTIAL

Using Profilessect Spring 31 introduced the concept of profiles

bull A set of beans that can be activated as required

bull Usually controlled by springprofilesactive system property

bull Cloud Foundry activates ldquocloudrdquo profile for you

46

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdgt ltbeans profile=profileAgt ltbean id=someId gt ltbean id=onlyInProfileAgt ltbeansgt

ltbeans profile=profileBgt ltbean id=someId gt ltbeansgt ltbean id=always-present gtltbeansgt

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 48: Cf intro for spring devs

CONFIDENTIAL

Using Profiles

47

ltbeans xmlns=httpwwwspringframeworkorgschemabeans xmlnsxsi=httpwwww3org2001XMLSchema-instance xmlnscloud=httpschemacloudfoundryorgspring xsischemaLocation=httpwwwspringframeworkorgschemabeans httpwwwspringframeworkorgschemabeansspring-beansxsdhttpschemacloudfoundryorgspring httpschemacloudfoundryorgspringcloudfoundry-spring-08xsdgt ltbeans profile=defaultgt ltbean id=dataSource class=BasicDataSourcegt ltbeangt ltbeansgt

ltbeans profile=cloudgt ltclouddata-source id=dataSource service-name=mysql-dbgt ltbeansgtltbeansgt

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 49: Cf intro for spring devs

Cloud Foundry BOSH

48

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 50: Cf intro for spring devs

CONFIDENTIAL

49

sect 500 ndash 5000 VMs

sect 40+ unique node types

sect 75+ unique software packages

sect 75+ unique environments

sect 2xweek cfcom updates

sect 24x7x365 non-stop operation

sect No-downtime deployments

sect Reliable robust repeatable deployments updates capacity adjustments

sect Small teams manage many instances

Production Grade Cloud Foundry Clusters

Google style problem egrave Google style solution

cloudfoundrycom

production staging stress qa dev

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 51: Cf intro for spring devs

CONFIDENTIAL

50

sect Cloud Foundry BOSH is an open source tool-chain for release engineering deployment and lifecycle management of large scale distributed servicesbull Prescriptive way of creating releases and managing systems and services

bull It is not a collection of shell scripts not a pile of Perl

sect Built to deploy and manage production-class large scale clustersbull Production grade Cloud Foundry clusters 500+ VMs 40+ jobs 75+ packages

bull Multi-node multi-tier complex clusters eg our GerritJenkins Cluster

sect Built for devops usage and scale by a crack team of veteransbull A project not a product command line interface YAML etc

bull Continuous improvement iterative development rough edges

Cloud Foundry BOSH

githubcomcloudfoundrybosh

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 52: Cf intro for spring devs

CONFIDENTIAL51

BOSH under the hood

bosh cli

redis natsdb

director healthmon

IaaS CPI

workers

stemcellagent

blobs

ldquoBOSH is deployed by BOSHrdquo

cloudfoundrycom

BOSH User

active jobs

disk

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 53: Cf intro for spring devs

CONFIDENTIAL

52

IaaS neutral by design

CPI code completefunctional status ldquowork in progressrdquo

vSphere battle tested implementation thousands of deploymentsvCloud Director ldquowork in progressrdquo 2H 2012

contribute githubcomcloudfoundrybosh

Cloud Provider Interface (CPI)

Cloud Foundry BOSH

githubcompistonopenstack-bosh-cpi

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 54: Cf intro for spring devs

CONFIDENTIAL

BOSH ResourcesDrNic

httpdrnicwilliamscom20120416creating-a-bosh-from-scratch-on-aws

53

BrianMMcClainhttpwwwbrianmmcclaincom20120508using-bosh-with-vsphere-part-2

httpsgithubcomcloudfoundrybosh

httpsgroupsgooglecomacloudfoundryorggroupbosh-userstopics

httpsgithubcompistonopenstack-bosh-cpi

VadimSpivakhttpwwwyoutubecomwatchv=pASQT5mGc_g

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 55: Cf intro for spring devs

CONFIDENTIAL

54

Key Takeaways

sect PaaS is the application platform for the Cloud era

sect Cloud Foundry is the Industryrsquos Open PaaSbull Developer agility

bull Portability without changes

bull Open system

sect Whatrsquos nextbull Free Signup wwwcloudfoundrycom (use ldquocloudtodayrdquo as a promocode)

bull Get started docscloudfoundrycomgetting-startedhtml

bull Learn more on the blog blogcloudfoundrycom

bull Download your Micro Cloud Foundry mycloudfoundrycommicro

bull Get the source code wwwcloudfoundryorg

bull Follow us cloudfoundry

bull Watch us wwwyoutubecomcloudfoundry

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 56: Cf intro for spring devs

CONFIDENTIAL

55

Eric BOTTARDDeveloper Advocateebottard ebottardvmwarecom

Thank You

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56

Page 57: Cf intro for spring devs

CONFIDENTIAL

Creditssect With slides and ideas from

bull Josh Long (starbuxman)

bull Patrick Chanezon (chanezon)

sect Imagesbull httpwwwsxchuphoto651837

bull httpwwwsxchuphoto525580

bull httpwwwsxchuphoto1234314

bull httpwwwsxchuphoto1080691

bull httpwwwsxchuphoto1409317

bull httpwwwsxchuphoto830331

56