vagrant devopsdays mountain view 2011
TRANSCRIPT
![Page 1: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/1.jpg)
VagrantEcosystem
Patrick Debois
Friday 17 June 2011
![Page 2: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/2.jpg)
Info & Credits
• Mitchell Hashimoto & John Bender
• http://vagrantup.com
• Based on Virtualbox , Ruby
• Runs on Mac OS, Linux, Windows
Friday 17 June 2011
![Page 3: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/3.jpg)
Let’s get this project started
AHA
Friday 17 June 2011
![Page 4: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/4.jpg)
Vagrant 101
Friday 17 June 2011
![Page 5: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/5.jpg)
The power of CLI
$ gem install vagrant$ vagrant box add base http://files.vagrantup.com/lucid32.box$ vagrant init$ vagrant up
Friday 17 June 2011
![Page 6: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/6.jpg)
Step 1 : installation
$ gem install vagrant$ vagrant box add base http://files.vagrantup.com/lucid32.box$ vagrant init$ vagrant up
Installs the vagrant ruby software
Friday 17 June 2011
![Page 7: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/7.jpg)
Step 2 : base box
$ gem install vagrant
$ vagrant box add base http://files.vagrantup.com/lucid32.box$ vagrant init$ vagrant up
Downloads predefined VM - f.i. Ubuntu 10.04 (Lucid)and registers it as name ‘base’
‘BASE’LUCID
Friday 17 June 2011
![Page 8: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/8.jpg)
Step 3 : configuration
$ gem install vagrant$ vagrant box add base http://files.vagrantup.com/lucid32.box
$ vagrant init$ vagrant up
Creates a standard configuration file
Friday 17 June 2011
![Page 9: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/9.jpg)
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 fileLinks our project with the ‘Base’ box
Friday 17 June 2011
![Page 10: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/10.jpg)
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 VM
Friday 17 June 2011
![Page 11: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/11.jpg)
Ready to rock SSH
KA-CHING
Friday 17 June 2011
![Page 12: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/12.jpg)
I ♥ Vagrant
Friday 17 June 2011
![Page 13: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/13.jpg)
Reduces Setup Time
1 2 3 4
No-VMSSH
Ready
♥
Automated
Friday 17 June 2011
![Page 14: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/14.jpg)
Simplicity♥
$ gem install vagrant$ vagrant box add base http://files.vagrantup.com/lucid32.box$ vagrant init$ vagrant up
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||]
copyto|cp <vmname>|<uuid> <source on host> <destination on guest> --username <name> --password <password> [--dryrun] [--follow] [--recursive] [--verbose]
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
![Page 15: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/15.jpg)
Self-Servicing♥
Basebox
“PULL”
Friday 17 June 2011
![Page 16: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/16.jpg)
Consistency
♥
Basebox
DEVELOPER1 DEVELOPER2
Friday 17 June 2011
![Page 17: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/17.jpg)
Repeatability
♥
Basebox
UP DESTROY UP DESTROY
t1 t2 t3 t4
Friday 17 June 2011
![Page 18: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/18.jpg)
Contained
♥
Project 1 Project 2 Project 3
Laptop
Friday 17 June 2011
![Page 19: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/19.jpg)
Vagrant 201
Friday 17 June 2011
![Page 20: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/20.jpg)
FileSharing
/home/patrick/data
/data
config.vm.share_folder "datastore", "/data", "./data"
Friday 17 June 2011
![Page 21: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/21.jpg)
Port Forwarding
80
8080
# 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
Friday 17 June 2011
![Page 22: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/22.jpg)
Non-Intrusive
♥
Project 1 Project 2 Project 3
Laptop
My Editor My IDE My BrowserFriday 17 June 2011
![Page 23: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/23.jpg)
Multi VM Stack
♥
DB DB DB
Project 1 Project 2 Project 3
APP APP APP
WEB WEB WEBconfig.vm.define :web do |web_config| web_config.vm.box = "ubuntu"
...endconfig.vm.define :app do |app_config| app_config.vm.box = "ubuntu"
...endconfig.vm.define :db do |db_config| db_config.vm.box = "ubuntu"
...end
Friday 17 June 2011
![Page 24: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/24.jpg)
Vagrant 301
Friday 17 June 2011
![Page 25: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/25.jpg)
Basebox
Provision
Just EnoughOperating System
Provisionerchef/puppet/script
+
Cookbooks/Manifests
VM
Friday 17 June 2011
![Page 26: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/26.jpg)
Vagrantbox.esGareth Rushgrove
Friday 17 June 2011
![Page 27: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/27.jpg)
CLI Vagrantbox.es
>> vagrant vagrantboxes search centos
3 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.box9 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
![Page 28: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/28.jpg)
Package
Basebox
Just EnoughOperating System
Provisionerchef/puppet/script
+
Cookbooks/Manifests
VM Basebox
Friday 17 June 2011
![Page 29: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/29.jpg)
Provision Configconfig.vm.provision :chef_solo do |chef| chef.cookbooks_path = ["chefrepo/cookbooks"]
chef.add_recipe("app_rails")chef.json.merge!({
:apache => { :listen_ports => [ "8080"]})
end ChefSolo
ChefServer
Puppet standalone
Puppet Server
config.vm.provision :puppet do |puppet| puppet.pp_path = "/tmp/vagrant-puppet" puppet.manifests_path = "./manifests" puppet.module_path = "./modules" puppet.manifest_file = "newbox.pp" end
Friday 17 June 2011
![Page 30: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/30.jpg)
Self-Executable Boxes
• java -jar mygreatbox.jar
http://www.jedi.be/blog/2011/03/31/installable-vagrant-boxes/https://github.com/maestrodev/wanton
“proof of concept”
Friday 17 June 2011
![Page 31: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/31.jpg)
Veewee
https://github.com/jedi4ever/veewee
Basebox
Just EnoughOperating System
Provisionerchef/puppet/script
ISO
Kickstart/Preseed/Autoyast/
AutoUnattendUbuntu, Debian, Centos,
Fedora, Gentoo, Solaris, Suse, Archlinux,
Windows
Friday 17 June 2011
![Page 32: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/32.jpg)
Version ControlledBasebox
Just EnoughOperating System
Provisionerchef/puppet/script
ISO
Kickstart/Preseed/Autoyast/
AutoUnattend
VM
♥
Git Repo Git Repo
Cookbooks/Manifests
Vagrantfile
Git RepoFriday 17 June 2011
![Page 33: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/33.jpg)
Complex Setups
VM
♥
Cookbooks/Manifests
Rails Nodejs FlumeHadoop Esper
Mysql HDFSPostgres JavaFriday 17 June 2011
![Page 34: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/34.jpg)
Sharing on Github
Kickstart/Preseed/Autoyast/
AutoUnattend
♥
Git Repo Git Repo
Cookbooks/Manifests
Vagrantfile
Git Repo
Veewee Chef/Puppet Vagrant
Friday 17 June 2011
![Page 35: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/35.jpg)
Kickstart/Preseed/Autoyast/
AutoUnattend
Git Repo Git Repo
Cookbooks/Manifests
Vagrantfile
Git Repo
Git Repo
Application Code
Shared “codebase”♥
Friday 17 June 2011
![Page 36: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/36.jpg)
Kickstart/Preseed/Autoyast/
AutoUnattend
Git Repo
Git Repo
Cookbooks/Manifests
Vagrantfile
Git Repo
Git Repo
Application Code
Co-Ownership♥
DEV & OPSpairing
Friday 17 June 2011
![Page 37: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/37.jpg)
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 restore
♥
Friday 17 June 2011
![Page 38: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/38.jpg)
Synchronized Release Cycle
♥
Application vX
System vX
Application vX+1
System vX+1
Friday 17 June 2011
![Page 39: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/39.jpg)
Tools/Config Consistency
♥
Cookbooks/Manifests
Cookbooks/Manifests
DEV PROD
Provisionerchef/puppet/script
Provisionerchef/puppet/script
Kickstart/Preseed/Autoyast/
AutoUnattend
Kickstart/Preseed/Autoyast/
AutoUnattend
Friday 17 June 2011
![Page 40: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/40.jpg)
• vagrant-snap - snapshots -
• https://github.com/t9md/vagrant-snap
• sahara - sandbox execution apply, rollback
• https://github.com/jedi4ever/sahara
Fail-Safe♥
Friday 17 June 2011
![Page 41: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/41.jpg)
Disposable Test Environments♥
Cookbooks/Manifests
Cookbooks/Manifests
DEV PROD
Provisionerchef/puppet/script
Provisionerchef/puppet/script
Kickstart/Preseed/Autoyast/
AutoUnattend
Kickstart/Preseed/Autoyast/
AutoUnattend
TEST/QA
http://paperairoplane.net/?p=240
Cookbooks/Manifests
Provisionerchef/puppet/script
Kickstart/Preseed/Autoyast/
AutoUnattend
Friday 17 June 2011
![Page 42: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/42.jpg)
Reuse Workflow
Vagrant Mccloud
https://github.com/geemus/fog
https://github.com/jedi4ever/mccloud
♥
Friday 17 June 2011
![Page 43: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/43.jpg)
Vagrant - EC2‘BASE’ BOX
Shared Folder
Loadbalancing
MultiVM
Port Forwarding
Cloudformation
Recipes/Manifest
AMI
Rsync
MultiVM
SSH Forwarding
Recipes/Manifest
SnapshotPackage
ENV=dev,prod
Friday 17 June 2011
![Page 44: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/44.jpg)
Future 1expand virtualization
Vagrant Mccloud
♥
Friday 17 June 2011
![Page 45: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/45.jpg)
Future 2: Expand baseboxes
Vagrant & Veewee & Mccloud
♥
Linux Windows OSX
Friday 17 June 2011
![Page 46: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/46.jpg)
Future 3: integrate in dev tools
♥
EclipsePlugin
JenkinsPlugin
MavendeployPlugin
Friday 17 June 2011
![Page 47: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/47.jpg)
Future 4: dev environment in a box
♥
VI
Eclipse+ plugins
Textmate
Browsers+ plugins
Debug tools Database tools
Download tools
Friday 17 June 2011
![Page 48: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/48.jpg)
“It works on my machine”
♥
Friday 17 June 2011
![Page 49: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/49.jpg)
For Devs(Test Code)
Friday 17 June 2011
![Page 50: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/50.jpg)
For Ops(Test Manifests)
Friday 17 June 2011
![Page 51: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/51.jpg)
For QA(Explore)
Friday 17 June 2011
![Page 52: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/52.jpg)
For Sales(To show off)
Friday 17 June 2011
![Page 53: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/53.jpg)
Bridgingfour worlds
without changing!
♥
http://www.jedi.be/blog/2011/03/28/using-vagrant-as-a-team/Friday 17 June 2011
![Page 54: Vagrant devopsdays Mountain View 2011](https://reader034.vdocument.in/reader034/viewer/2022052619/55511832b4c9052d0e8b4d9d/html5/thumbnails/54.jpg)
DemoTomorrow
Openspaces
♥
Friday 17 June 2011