Your SlideShare is downloading. ×
  • Like
Vagrant devopsdays Mountain View 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Vagrant devopsdays Mountain View 2011

  • 23,742 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • DevOps Mountain View 2011: Why Vagrant is Cool by Patrick Debois from dev2ops.org on Vimeo.<br /><object type="application/x-shockwave-flash" data="http://vimeo.com/moogaloop.swf?clip_id=25891810&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" width="350" height="288"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=25891810&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0"></param><embed src="http://vimeo.com/moogaloop.swf?clip_id=25891810&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" width="350" height="288" type="application/x-shockwave-flash"></embed></object>
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
23,742
On SlideShare
0
From Embeds
0
Number of Embeds
19

Actions

Shares
Downloads
136
Comments
1
Likes
41

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Vagrant Ecosystem Patrick DeboisFriday 17 June 2011
  • 2. Info & Credits • Mitchell Hashimoto & John Bender • http://vagrantup.com • Based on Virtualbox , Ruby • Runs on Mac OS, Linux, WindowsFriday 17 June 2011
  • 3. AHA Let’s get this project startedFriday 17 June 2011
  • 4. Vagrant 101Friday 17 June 2011
  • 5. The power of CLI $ gem install vagrant $ vagrant box add base http://files.vagrantup.com/lucid32.box $ vagrant init $ vagrant upFriday 17 June 2011
  • 6. Step 1 : installation $ gem install vagrant $ vagrant box add base http://files.vagrantup.com/lucid32.box $ vagrant init $ vagrant up Installs the vagrant ruby softwareFriday 17 June 2011
  • 7. Step 2 : base box $ gem install vagrant $ vagrant box add base http://files.vagrantup.com/lucid32.box $ vagrant init $ vagrant up ‘BASE’ LUCID Downloads predefined VM - f.i. Ubuntu 10.04 (Lucid) and registers it as name ‘base’Friday 17 June 2011
  • 8. Step 3 : configuration $ gem install vagrant $ vagrant box add base http://files.vagrantup.com/lucid32.box $ vagrant init $ vagrant up Creates a standard configuration fileFriday 17 June 2011
  • 9. Vagrantfile Vagrant::Config.run do |config| # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "base" end ‘BASE’ LUCID Vagrantfile = Project file Links our project with the ‘Base’ boxFriday 17 June 2011
  • 10. Step 4 : boot $ gem install vagrant $ vagrant box add base http://files.vagrantup.com/lucid32.box $ vagrant init $ vagrant up Extracts the ‘basebox’ Creates a new VM in Virtualbox based on ‘basebox’ Boots the new VMFriday 17 June 2011
  • 11. KA-CHING Ready to rock SSHFriday 17 June 2011
  • 12. I VagrantFriday 17 June 2011
  • 13. Reduces Setup Time 1 2 3 4 SSHNo-VM Automated ReadyFriday 17 June 2011
  • 14. Simplicity VBoxManage guestcontrol exec[ute] <vmname>|<uuid> <path to program> --username <name> --password <password> [--arguments "<arguments>"] [--environment "<NAME>=<VALUE> [<NAME>=<VALUE>]"] [--flags <flags>] [--timeout <msec>] [--verbose] [--wait-for exit,stdout,stderr||] $ gem install vagrant copyto|cp <vmname>|<uuid> $ vagrant box add base http://files.vagrantup.com/ <source on host> <destination on guest> lucid32.box --username <name> --password <password> $ vagrant init [--dryrun] [--follow] [--recursive] [--verbose] $ vagrant up createdir[ectory]|mkdir|md <vmname>|<uuid> <directory to create on guest> --username <name> --password <password> [--parents] [--mode <mode>] [--verbose] updateadditions <vmname>|<uuid> [--source <guest additions .ISO>] [--verbose]Friday 17 June 2011
  • 15. Self-Servicing Base box “PULL”Friday 17 June 2011
  • 16. Consistency Base box DEVELOPER1 DEVELOPER2Friday 17 June 2011
  • 17. Repeatability Base box UP DESTROY UP DESTROY t1 t2 t3 t4Friday 17 June 2011
  • 18. Contained Project 1 Project 2 Project 3 LaptopFriday 17 June 2011
  • 19. Vagrant 201Friday 17 June 2011
  • 20. FileSharing /data config.vm.share_folder "datastore", "/data", "./data" /home/patrick/dataFriday 17 June 2011
  • 21. Port Forwarding 80 # Forward a port from the guest to the host, which allows for outside # computers to access the VM, whereas host only networking does not. config.vm.forward_port "http", 80, 9000 config.vm.forward_port "redis", 6379, 6379 config.vm.forward_port "mysql", 3306, 3306 8080Friday 17 June 2011
  • 22. Non-Intrusive Project 1 Project 2 Project 3 Laptop My Editor My IDE My BrowserFriday 17 June 2011
  • 23. Multi VM Stack config.vm.define :web do |web_config| WEB WEB WEB web_config.vm.box = "ubuntu" ... end config.vm.define :app do |app_config| app_config.vm.box = "ubuntu" APP APP APP ... end config.vm.define :db do |db_config| db_config.vm.box = "ubuntu" DB DB DB ... end Project 1 Project 2 Project 3Friday 17 June 2011
  • 24. Vagrant 301Friday 17 June 2011
  • 25. Cookbooks/ Manifests + Provision Basebox Provisioner VM chef/puppet/script Just Enough Operating SystemFriday 17 June 2011
  • 26. Vagrantbox.es Gareth RushgroveFriday 17 June 2011
  • 27. CLI Vagrantbox.es >> vagrant vagrantboxes search centos3 centos 5.5 http://dl.dropbox.com/u/15307300/vagrant-0.7-centos-64-base.box6 opscode centos 5 http://opscode-vagrant-boxes.s3.amazonaws.com/centos5-gems.box7 opscode ubuntu 10.04 http://opscode-vagrant-boxes.s3.amazonaws.com/ubuntu10.04-gems.b9 puppet centos 5.5 64 http://puppetlabs.s3.amazonaws.com/pub/centos5_64.box10 puppet centos 4 64 http://puppetlabs.s3.amazonaws.com/pub/centos4_64.box21 centos 5.6 32 http://yum.mnxsolutions.com/vagrant/centos_56_32.box https://github.com/garethr/ruby-vagrantboxesFriday 17 June 2011
  • 28. Package Cookbooks/ Manifests + Basebox Base VM Provisioner chef/puppet/script box Just Enough Operating SystemFriday 17 June 2011
  • 29. Provision Config config.vm.provision :chef_solo do |chef| chef.cookbooks_path = ["chefrepo/cookbooks"] chef.add_recipe("app_rails") chef.json.merge!({ :apache => { :listen_ports => [ "8080"] Puppet }) end standalone Chef config.vm.provision :puppet do |puppet| Solo puppet.pp_path = "/tmp/vagrant-puppet" puppet.manifests_path = "./manifests" puppet.module_path = "./modules" puppet.manifest_file = "newbox.pp" end Chef PuppetFriday 17 June 2011 Server Server
  • 30. Self-Executable Boxes • java -jar mygreatbox.jar “proof of concept” http://www.jedi.be/blog/2011/03/31/installable-vagrant-boxes/ https://github.com/maestrodev/wantonFriday 17 June 2011
  • 31. Veewee ISO Basebox Provisioner chef/puppet/script Kickstart/Preseed/ Autoyast/ AutoUnattend Ubuntu, Debian, Centos, Just Enough Fedora, Gentoo, Operating System Solaris, Suse, Archlinux, Windows https://github.com/jedi4ever/veeweeFriday 17 June 2011
  • 32. Version Controlled Basebox Provisioner chef/puppet/script ISO VM Just Enough Operating System Kickstart/Preseed/ Autoyast/ Cookbooks/ Vagrant AutoUnattend Manifests file Git Repo Git Repo Git RepoFriday 17 June 2011
  • 33. Complex Setups VM Cookbooks/ Manifests Rails Nodejs Hadoop Esper Flume Postgres Mysql HDFS JavaFriday 17 June 2011
  • 34. Sharing on Github Veewee Chef/Puppet Vagrant Kickstart/Preseed/ Autoyast/ Cookbooks/ Vagrantfile AutoUnattend Manifests Git Repo Git Repo Git RepoFriday 17 June 2011
  • 35. Shared “codebase” Kickstart/Preseed/ Autoyast/ Cookbooks/ Vagrantfile AutoUnattend Manifests Git Repo Git Repo Git Repo Application Code Git RepoFriday 17 June 2011
  • 36. Co-Ownership Cookbooks/ Manifests Git Repo Kickstart/Preseed/ Vagrantfile Autoyast/ AutoUnattend DEV & OPS Git Repo pairing Git Repo Application Code Git RepoFriday 17 June 2011
  • 37. More Ops into Dev • can we speed up this provisioning? • we need a migration script from vX -> vY • we need start/stop scripts • we need consistent data restoreFriday 17 June 2011
  • 38. Synchronized Release Cycle Application vX Application vX+1 System vX System vX+1Friday 17 June 2011
  • 39. Tools/Config Consistency DEV PROD Kickstart/Preseed/ Kickstart/Preseed/ Autoyast/ Autoyast/ AutoUnattend AutoUnattend Cookbooks/ Cookbooks/ Manifests Manifests Provisioner Provisioner chef/puppet/script chef/puppet/scriptFriday 17 June 2011
  • 40. Fail-Safe • vagrant-snap - snapshots - • https://github.com/t9md/vagrant-snap • sahara - sandbox execution apply, rollback • https://github.com/jedi4ever/saharaFriday 17 June 2011
  • 41. Disposable Test Environments DEV TEST/QA PROD Kickstart/Preseed/ Kickstart/Preseed/ Kickstart/Preseed/ Autoyast/ Autoyast/ Autoyast/ AutoUnattend AutoUnattend AutoUnattend Cookbooks/ Cookbooks/ Cookbooks/ Manifests Manifests Manifests Provisioner Provisioner Provisioner chef/puppet/script chef/puppet/script chef/puppet/script http://paperairoplane.net/?p=240Friday 17 June 2011
  • 42. Reuse Workflow https://github.com/geemus/fog Vagrant Mccloud https://github.com/jedi4ever/mccloudFriday 17 June 2011
  • 43. Vagrant - EC2 ‘BASE’ BOX AMI MultiVM MultiVM Recipes/Manifest Recipes/Manifest Shared Folder Rsync Port Forwarding SSH Forwarding Package Snapshot ENV=dev,prod Loadbalancing CloudformationFriday 17 June 2011
  • 44. Future 1 expand virtualization Vagrant MccloudFriday 17 June 2011
  • 45. Future 2: Expand baseboxes Linux Windows OSX Vagrant & Veewee & MccloudFriday 17 June 2011
  • 46. Future 3: integrate in dev tools Maven Eclipse Jenkins deploy Plugin Plugin PluginFriday 17 June 2011
  • 47. Future 4: dev environment in a box Eclipse Browsers + plugins + plugins VI Textmate Debug tools Database tools Download toolsFriday 17 June 2011
  • 48. “It works on my machine”Friday 17 June 2011
  • 49. For Devs (Test Code)Friday 17 June 2011
  • 50. For Ops (Test Manifests)Friday 17 June 2011
  • 51. For QA (Explore)Friday 17 June 2011
  • 52. For Sales (To show off)Friday 17 June 2011
  • 53. Bridging four worlds without changing! http://www.jedi.be/blog/2011/03/28/using-vagrant-as-a-team/Friday 17 June 2011
  • 54. Demo Tomorrow OpenspacesFriday 17 June 2011