2. Introduction
1. Cloud Foundry is an open source cloud
computing platform as a service (PaaS) [1].
2. Developed by VMware [1].
3. Apache License 2.0 [1].
4. The industry’s first open platform as a
service [2]
5. Derek Collison and Mark Lucovsky - Two of
the Super Coders Behind Cloud Foundry when
it was initially started in April 2011 [3].
4. Why Cloud Foundry?
● Developers Agility - No one between you and your
application [5]
● Optimized Software Delivery - Portability without
changes – Dev/Test/Production, Private/Public clouds
[5]
5. Why Cloud Foundry?
● Open System - The freedom to choose [5]
○ Choice of clouds for deployment, across public,
private and hybrid clouds
■ CloudFoundry.com – VMware's operated Cloud
Service
■ Micro Cloud Foundry™
○ Choice of industry standard frameworks. Spring for
Java, Scala etc.
○ Choice of application services. RabbitMQ, MySQL,
MongoDB etc
○ Extensible architecture
○ A Community open-source project
6. Choice of Developer Frameworks
(The Top of the Triangle)
Cloud Foundry supports the following
application development frameworks [6]:
1. Spring/Java
2. Ruby on Rails
3. Ruby and Sinatra
4. Node.js
5. Grails
7. Frameworks
● The support includes a runtime environment
that enables your applications to execute on
Cloud Foundry
● Deployment tools (vmc and STS) detect the
framework and automate configuration and
deployment to Cloud Foundry
● Can bind with services, such as database
8. Choice of Application Services (The
Left Side of the Triangle)
Cloud Foundry services [7]:
1. MySQL, the open source relational database.
2. vFabric Postgres, relational database based on
PostgreSQL.
3. MongoDB, the scalable, open, document-based
database.
4. Redis, the open key-value data structure server.
5. RabbitMQ, for reliable, scalable, and portable
messaging.
9. Services
● To access Cloud Foundry services from your
application, you first create a service, and
then bind it to your application [7].
● When your application runs on Cloud
Foundry, the environment contains a
VCAP_SERVICES variable that has
information about all the services bound to
the application. The content of this variable
is a JSON document [7].
11. Choice of Clouds (The Right Side of
the Triangle)
● Public, Private, VMware based and non-
VMware based it up to the developer and
organization as to where they want to run
Cloud Foundry [4].
● Cloud Foundry can run on top of vSphere
and vCloud Infrastructure [4].
13. Micro Cloud Foundry
● Micro Cloud Foundry™ - now you can run a
complete instance of Cloud Foundry on your
own computer [8].
● It is a full instance of Cloud Foundry that
provides the flexibility of local development
while preserving your options for future
deployment and scaling of your applications
[9].
14. Micro Cloud Foundry
Just 3 steps [8]:
1. Install - VMware Player (free)
2. Login using CloudFoundry.com credentials
3. Download Micro Cloud Foundry virtual
machine image (It's about 1.4GB)
prompt$ du -h micro-v119-20121113.000224.zip
1.4G micro-v119-20121113.000224.zip
16. Micro Cloud Foundry Configuration
● When you first start the VM, it will prompt to configure
the Micro Cloud Foundry instance.
● Set password for the ‘root’ and ‘vcap’
● The ‘root’ and ‘vcap’ users are the administrative/control
accounts for your Micro Cloud Foundry VM [9].
● Micro Cloud Foundry networking is also configured.
● Enter DNS configuration token, which is received on the
page where you downloaded the Micro Cloud VM. (This
is very important to work in offline mode as we are
relying on DNS lookup)
18. Micro Cloud Foundry Configuration
Can use SSH tunnel to access the Micro Cloud
Foundry VM [10]
19. Working Offline With Micro Cloud
Foundry
● Virtual Machine Settings -> Network Adapter
-> make sure that NAT is selected.
● Select option 6 to toggle to offline mode.
● Configure host computer to route DNS
requests to the Micro Cloud Foundry VM.
○ For DHCP:
edit the file /etc/dhcp3/dhclient.conf and add
this line:
prepend domain-name-servers <IP_VM>
21. Command-Line Interface (vmc)
Cloud Foundry command-line interface can be
used to execute all the Cloud Foundry
operations, such as configuring your
applications and deploying them to Cloud
Foundry [11].
Prerequisite: Ruby and RubyGems
prompt$ sudo gem install vmc
22. vmc target
Execute the vmc target command to specify the
Cloud Foundry target to which you will deploy
your applications [11].
1. To deploy on the PaaS Cloud Foundry,
specify https://api.cloudfoundry.com
2. To deploy on your local Micro Cloud
Foundry, specify http://api.<appname>.
cloudfoundry.me, where appname is the
domain you registered for your application at
the Micro Cloud Foundry Web site.
23. VMC Basic Commands
The following command targets the PaaS
Cloud Foundry [11]:
prompt$ vmc target https://api.cloudfoundry.
com
To determine your current target:
prompt$ vmc target
Login:
prompt$ vmc login
24. VMC Basic Commands
Ensure you have successfully logged in:
prompt$ vmc info
Change password:
prompt$ vmc passwd
View the full list of VMC commands:
prompt$ vmc help
25. Logging into Micro Cloud Foundry
First register a user:
prompt$ vmc register
Then login:
prompt$ vmc login
27. Deploying a Sample Application
A simple Java Web Application from Maven.
mvn archetype:generate -DgroupId=org.example -
DartifactId=maven-webapp -DarchetypeArtifactId=maven-
archetype-webapp
Run “mvn package” to create war file.
Change directory to “target”
Deploy the application using the vmc push command:
prompt$ vmc push
28. Deploying a Sample Application
You can specify one or all of the following options to pass
deployment values; if you do not specify an option, vmc
push will interactively prompt you for it [12]:
prompt$ vmc push <appname> --path <directory> --url
<deploymentURL> --instances <instance-number> --
memory <MB> --no-start
31. Getting Information about the Cloud
Foundry Target
Display the instances of these service types
created [12]:
prompt$ vmc services
32. Getting Information about
Applications
Display the list of applications that are currently
deployed for your account, along with
instances, health, and associated service
instances [12]:
prompt$ vmc apps
Display the standard output log entries for an
application [12]:
prompt$ vmc logs <appname>
33. Debugging Problems With Your
Applications
Viewing Log Files:
Use the "vmc files" command to get a list of
available log files [13]
34. Does Cloud Foundry Auto Scale?
According to Collison [14], Cloud Foundry
provides all the mechanisms to allow auto-
scaling, however auto-scaling at its simplest
form is not directly builtin.
Thorsten [15] answers to this question by
saying “no, but trivially so”
RightScale [16] provides dynamic server
configuration for Cloud Foundry with their All-
In-One Cloud Foundry ServerTemplate™.
35. Simplified Application Deployment
With Cloud Foundry “Manifest”
● Automates application deployments [17].
● The manifests feature uses a YAML
document, "manifest.yml" [17].
Ways to create manifest
● The manifest can be created by hand
● It can be created after a "vmc push"
36. Topics Not Covered
Eclipse Plugin & Debugging
Apache Maven
Support for other frameworks. eg: PHP
vmc tunnel (Accessing services)
37. References
[1] Wikipedia, “Cloud Foundry,” Wikipedia, the free encyclopedia, 2012.
[Online]. Available: http://en.wikipedia.org/wiki/Cloud_Foundry. [Accessed: 09-
Jan-2013].
[2] VMware, “Cloud Foundry — Delivering on VMware’s ‘Open PaaS’ Strategy,”
The Console Blog - VMware Blogs, 2011. [Online]. Available: http://blogs.
vmware.com/console/2011/04/cloud-foundry-delivering-on-vmwares-open-
paas-strategy.html. [Accessed: 09-Jan-2013].
[3] VMware, “Two of the Super Coders Behind Cloud Foundry,” CloudFoundry.
com Blog, 2011. [Online]. Available: http://blog.cloudfoundry.
com/2011/04/12/two-of-the-super-coders-behind-cloud-foundry/. [Accessed: 09-
Jan-2013].
[4] VMware, “Explaining The Magic Triangle,” CloudFoundry.com Blog, 2011.
[Online]. Available: http://blog.cloudfoundry.com/2011/04/14/explaining-the-
magic-triangle/. [Accessed: 09-Jan-2013].