Cloud foundry


Published on

Introduction Cloud Foundry and using Micro Cloud Foundry in your PC

Published in: Technology
1 Comment
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Cloud foundry

  1. 1. Cloud FoundryIntroduction
  2. 2. Introduction1. Cloud Foundry is an open source cloudcomputing 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 aservice [2]5. Derek Collison and Mark Lucovsky - Two ofthe Super Coders Behind Cloud Foundry whenit was initially started in April 2011 [3].
  3. 3. The Magic TriangleIt’s all about CHOICE! [4]
  4. 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. 5. Why Cloud Foundry?● Open System - The freedom to choose [5] ○ Choice of clouds for deployment, across public, private and hybrid clouds ■ – VMwares 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. 6. Choice of Developer Frameworks(The Top of the Triangle)Cloud Foundry supports the followingapplication development frameworks [6]:1. Spring/Java2. Ruby on Rails3. Ruby and Sinatra4. Node.js5. Grails
  7. 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. 8. Choice of Application Services (TheLeft Side of the Triangle)Cloud Foundry services [7]:1. MySQL, the open source relational database.2. vFabric Postgres, relational database based onPostgreSQL.3. MongoDB, the scalable, open, document-baseddatabase.4. Redis, the open key-value data structure server.5. RabbitMQ, for reliable, scalable, and portablemessaging.
  9. 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].
  10. 10. Eg: VCAP_SERVICES variable(JSON){ "mysql-5.1" : [ { "credentials" : { "host" : "", "hostname" : "", "name" : "dd6c83789383c421287bdb25b63eca1a6", "password" : "pYS3fjgQTmO7I", "port" : 3306, "user" : "uTdRF0y1H2R9r", "username" : "uTdRF0y1H2R9r" }, "label" : "mysql-5.1", "name" : "mysql-service", "plan" : "free", "tags" : [ "relational", "mysql-5.1", "mysql" ] }]}
  11. 11. Choice of Clouds (The Right Side ofthe 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].
  12. 12. – VMwaresoperated Cloud Service
  13. 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. 14. Micro Cloud FoundryJust 3 steps [8]:1. Install - VMware Player (free)2. Login using credentials3. Download Micro Cloud Foundry virtualmachine image (Its about 1.4GB)prompt$ du -h micro-v119-20121113.000224.zip1.4G
  15. 15. Micro Cloud Foundry VM
  16. 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)
  17. 17. Micro Cloud Foundry Configuration
  18. 18. Micro Cloud Foundry ConfigurationCan use SSH tunnel to access the Micro CloudFoundry VM [10]
  19. 19. Working Offline With Micro CloudFoundry● 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 addthis line:prepend domain-name-servers <IP_VM>
  20. 20. Cloud Foundry tools● Command-Line Interface (vmc)● Eclipse Plugin● Apache Maven
  21. 21. Command-Line Interface (vmc)Cloud Foundry command-line interface can beused to execute all the Cloud Foundryoperations, such as configuring yourapplications and deploying them to CloudFoundry [11].Prerequisite: Ruby and RubyGemsprompt$ sudo gem install vmc
  22. 22. vmc targetExecute the vmc target command to specify theCloud Foundry target to which you will deployyour applications [11].1. To deploy on the PaaS Cloud Foundry,specify https://api.cloudfoundry.com2. To deploy on your local Micro CloudFoundry, specify http://api.<appname>, where appname is thedomain you registered for your application atthe Micro Cloud Foundry Web site.
  23. 23. VMC Basic CommandsThe following command targets the PaaSCloud Foundry [11]:prompt$ vmc target https://api.cloudfoundry.comTo determine your current target:prompt$ vmc targetLogin:prompt$ vmc login
  24. 24. VMC Basic CommandsEnsure you have successfully logged in:prompt$ vmc infoChange password:prompt$ vmc passwdView the full list of VMC commands:prompt$ vmc help
  25. 25. Logging into Micro Cloud FoundryFirst register a user:prompt$ vmc registerThen login:prompt$ vmc login
  26. 26. vmc target & vmc login (PublicCloud)
  27. 27. Deploying a Sample ApplicationA simple Java Web Application from Maven.mvn archetype:generate -DgroupId=org.example -DartifactId=maven-webapp -DarchetypeArtifactId=maven-archetype-webappRun “mvn package” to create war file.Change directory to “target”Deploy the application using the vmc push command:prompt$ vmc push
  28. 28. Deploying a Sample ApplicationYou can specify one or all of the following options to passdeployment values; if you do not specify an option, vmcpush will interactively prompt you for it [12]:prompt$ vmc push <appname> --path <directory> --url<deploymentURL> --instances <instance-number> --memory <MB> --no-start
  29. 29. Deploying a Sample Application
  30. 30. Deploying a Sample Application
  31. 31. Getting Information about the CloudFoundry TargetDisplay the instances of these service typescreated [12]:prompt$ vmc services
  32. 32. Getting Information aboutApplicationsDisplay the list of applications that are currentlydeployed for your account, along withinstances, health, and associated serviceinstances [12]:prompt$ vmc appsDisplay the standard output log entries for anapplication [12]:prompt$ vmc logs <appname>
  33. 33. Debugging Problems With YourApplicationsViewing Log Files:Use the "vmc files" command to get a list ofavailable log files [13]
  34. 34. Does Cloud Foundry Auto Scale?According to Collison [14], Cloud Foundryprovides all the mechanisms to allow auto-scaling, however auto-scaling at its simplestform is not directly builtin.Thorsten [15] answers to this question bysaying “no, but trivially so”RightScale [16] provides dynamic serverconfiguration for Cloud Foundry with their All-In-One Cloud Foundry ServerTemplate™.
  35. 35. Simplified Application DeploymentWith 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. 36. Topics Not CoveredEclipse Plugin & DebuggingApache MavenSupport for other frameworks. eg: PHPvmc tunnel (Accessing services)
  37. 37. References[1] Wikipedia, “Cloud Foundry,” Wikipedia, the free encyclopedia, 2012.[Online]. Available: [Accessed: 09-Jan-2013].[2] VMware, “Cloud Foundry — Delivering on VMware’s ‘Open PaaS’ Strategy,”The Console Blog - VMware Blogs, 2011. [Online]. Available: [Accessed: 09-Jan-2013].[3] VMware, “Two of the Super Coders Behind Cloud Foundry,” Blog, 2011. [Online]. Available: [Accessed: 09-Jan-2013].[4] VMware, “Explaining The Magic Triangle,” Blog, 2011.[Online]. Available: [Accessed: 09-Jan-2013].
  38. 38. References[5] VMware, “About Cloud Foundry,” 2013. [Online]. Available: [Accessed: 09-Jan-2013].[6] VMware, “Frameworks Overview,” Documentation, 2012. [Online]. Available: [Accessed: 09-Jan-2013].[7] VMware, “Services Overview,” Documentation, 2012. [Online]. Available: [Accessed: 09-Jan-2013].[8] VMware, “Micro Cloud Foundry,” 2012. [Online]. Available: [Accessed: 09-Jan-2013].[9] VMware, “‘We Shrunk the Cloud’ – Introducing Micro Cloud Foundry forDevelopers,” Blog, 2011. [Online]. Available: [Accessed: 09-Jan-2013].[10] VMware, “Working Offline with Micro Cloud Foundry,” CloudFoundry.comBlog, 2011. [Online]. Available: [Accessed: 09-Jan-2013].
  39. 39. References[11] VMware, “VMC Installation,” Documentation, 2012. [Online]. Available: [Accessed: 09-Jan-2013].[12] VMware, “VMC Quick Reference,” Documentation, 2012. [Online].Available:[Accessed: 09-Jan-2013].[13] VMware, “Debugging with VMC,” Documentation, 2012. [Online]. Available: [Accessed: 09-Jan-2013].[14] D. Collison, “auto scaling in cloud foundry : Support,”2011. [Online]. Available: [Accessed: 10-Jan-2013].
  40. 40. References[15] Thorsten, “Cloud Foundry Architecture and Auto-Scaling,” RightScale Blog,2011. [Online]. Available: [Accessed: 10-Jan-2013].[16] RightScale, “RightScale Free Edition | RightScale Cloud ManagementPlatform,” 2013. [Online]. Available: [Accessed: 10-Jan-2013].[17] VMware, “Simplified Application Deployment With Cloud Foundry‘Manifest’,” Blog, 2012. [Online]. Available: [Accessed: 10-Jan-2013].