Vagrant for Virtualized Development

Adam Culp
Adam CulpWeb Engineer/Consultant at Rogue Wave
Vagrant for Virtualized
Development
By:
Adam Culp
Twitter: @adamculp
https://joind.in/10538
2
Vagrant for Virtualized Development
●
About me
– PHP 5.3 Certified
– Consultant at Zend Technologies
– Organizer SoFloPHP (South Florida)
– Organized SunshinePHP (Miami)
– Long distance (ulramarathon) runner
– Judo Black Belt Instructor
3
Vagrant for Virtualized Development
● Shortfalls of development environments
– Does not mirror “testing” or “production” setup.
– Each developer has a different one.
● Easily out of sync with standards
● Many versions of (php, mysql, apache, etc.)
– Long ramp-up/training for new developers
– It works for me!
4
Vagrant for Virtualized Development
● Vagrant - http://vagrantup.com
– Virtualized development environments made easy
●
Command line tool
●
Lowers setup time
● Fully control entire environments and versions
● Eliminates “works on my machine” excuse
● Uses:
– VirtualBox
– VMWare
– AWS
– Others....
● Can use Puppet or Chef
● FREE and open source
5
Vagrant for Virtualized Development
●
Benefits of Using Vagrant
– Solo Developers
●
Maintain consistency across multiple projects.
●
Can run multiple environments on a single host machine.
(Dev., Test, Staging)
●
Easily tear down and rebuild.
– Teams
●
Identical development environments.
●
Consistent and portable.
– Companies
●
Easier onboarding of new talent.
●
Build once and distribute to teams.
6
Vagrant for Virtualized Development
● Vagrant minimum requirements
– VirtualBox and Hyper-V supported out of the box
– Ruby
– Vagrant
● Installers for MAC, Windows, various Linux
● Talks to VirtualBox and builds virtual machine based on a “base box”.
– Chef or Puppet
● These require separate installation
● Enables setup and configuration of advanced services you may need in your
environment.
7
Vagrant for Virtualized Development
● Vagrant Basic “How To”
– Navigate (via terminal) to your project.
– Find a base box: http://vagrantbox.es
– Execute two simple commands:
● vagrant init
● vagrant up
8
Vagrant for Virtualized Development
9
Vagrant for Virtualized Development
● Vagrant Base Box Commands
– Many base boxes available over the Internet, or
you can create your own.
● Creation convention should be followed.
– A base box must be added via local file or HTTP.
10
Vagrant for Virtualized Development
● Vagrant Base Box Commands
– You can list current “installed” base boxes.
11
Vagrant for Virtualized Development
● Vagrant Base Box Commands
– Or you can remove current base boxes.
● Remember to include provider.
12
Vagrant for Virtualized Development
● Vagrant Configuration File (Vagrantfile)
– Simple Ruby code which typically contains a Vagrant
configuration block.
– First thing loaded by Vagrant.
– Basic file created when 'init' is called from within a
directory.
– Add more options for more configuration.
13
Vagrant for Virtualized Development
● Sample Vagrantfile
14
Vagrant for Virtualized Development
● Suspend / Halt / Destroy
– To shut down we can:
● “suspend” to save the current state of the
machine. (does not return disk space, about
1GB)
● “halt” which is a graceful shutdown.
●
“destroy” everything. (requires re-provision)
– If we “suspended” to shut down last time you can
use “vagrant resume” or “vagrant up” when
returning, otherwise we use “vagrant up”.
15
Vagrant for Virtualized Development
●
SSH
– Vagrant makes SSH to the virtual machine easy
from within the project directory.
– Project files are available in the VM at '/vagrant' by
default, but can be changed.
– The VM has both read and write access to the
shared folder.
– Gain root (su) access use “sudo”.
16
Vagrant for Virtualized Development
● Port Forwarding
– By default your host machine should be able to
access the virtual machine by IP address. However,
we need to activate port forwarding for services.
– For HTTP:
– Then we simply reload Vagrant.
$ vagrant reload
17
Vagrant for Virtualized Development
● Provisioning
– We can set up some provisioning automation in
Vagrant by including a shell script.
– Link to a shell script in the Vagrantfile.
18
Vagrant for Virtualized Development
● Sample Shell Script
19
Vagrant for Virtualized Development
●
Packaging Your Own
– Start with a Base Box
●
Customize it as needed, unless relying solely on
provisioning with Chef or Puppet.
●
Run command to package
$ vagrant package –vagrantfile Vagrantfile.pkg
●
Creates 'package.box' in same directory.
●
Distribute via raw file or via HTTP, for others.
●
Other users can now use:
$ vagrant box add my_box /path/to/the/package.box
$ vagrant init my_box
$ vagrant up
20
Vagrant for Virtualized Development
● Packaging Your Own (from scratch)
– Simple enough to do.
– Follow Vagrant standards, especially if you plan to
share it.
● Set sizes of partition and RAM.(40GB/360MB)
● Set Domain and Hostname
●
Create Vagrant user, and password.
● Create some groups
● Ruby, RubyGems, Puppet, Chef, SSH with public keys
● Set sudo permissions
● Create /vagrant directory
21
Vagrant for Virtualized Development
● Provisioning
– Using Chef or Puppet we can create a script to alter
the VM.
●
Install apps
●
Edit config files
●
Many tasks needed to go from Base Box to desired
environment.
– Manifests (or recipe for Chef)
●
Manifests sub-directory within project.
●
Default.pp is the default file loaded.
22
Vagrant for Virtualized Development
● Advanced Capabilities of Vagrant
– Many advanced topics available under
Documentation on the Vagrant site.
●
Modules within Manifests to encapsulate Puppet
files.
●
Create your own Base Boxes
●
Multi-VM Environment
●
Plugins
●
NFS Shared Folders
23
Vagrant for Virtualized Development
● Puppet is:
– Automation software
● Help system admins manage infrastructure.
– Automates provisioning and configuration
– Automate repetitive tasks
– Ensure stability through consistency
– Open source and commercial versions
24
Vagrant for Virtualized Development
● Puppet Supported Operating Systems:
– RHEL
– CentOS
– Ubuntu
– Debian
– Scientific Linux
– Oracle Linux
– SUSE
– Solaris
– Windows
25
Vagrant for Virtualized Development
● Pieces
– Modules for popular
configurations
– Compose application
stack needed
– Rollout to the node
26
Vagrant for Virtualized Development
● Puppet Training
– Materials available on PuppetLabs site for FREE download.
●
Learning Puppet Tutorial
●
Learn Puppet VM to train on (VMWare or VirtualBox)
● Module cheatsheet
● Core types cheatsheet
● Users Guide
● Dashboard Manual
27
Vagrant for Virtualized Development
●
New tool PuPHPet
– Complex Vagrant setups made easy GUI.
●
Puppet manifest creation
●
Host (local, Digital Ocean, Rackspace).
●
Ubuntu version.
●
Set VM options.
● HTTP server. (Apache, Nginx)
●
PHP version. (5.5, 5.4, 5.3)
●
Or HHVM
●
Debugger (Xdebug).
●
Profiler (XHProf).
●
Drush
●
Database. (MySQL, PostgreSQL, MariaDB, MongoDB, Redis)
● Beantalkd or RabitMQ
●
Elastic Search
●
Create!
28
Vagrant for Virtualized Development
● New tool Rove.io
– Complex Vagrant setups made easy GUI.
●
Chef recipe creation
●
Database. (various)
● Language. (Node.js, PHP, Python, Ruby)
● SCM (Git, Mercurial, Subversion)
● HTTP server (Apache, Nginx)
● Generate!
29
Vagrant for Virtualized Development
● Resources
– http://vagrantup.com
– http://puppetlabs.com
– http://opscode.com/chef/
– http://virtualbox.org
– http://puPHPet.com
– http://getcomposer.org
– http://github.com
View details, slides, and rate at https://joind.in/10538
● Thank you
Adam Culp
http://www.geekyboy.com
http://github.com/adamculp
Twitter @adamculp
View details, slides, and rate at https://joind.in/10538
1 of 30

Recommended

Intro to vagrant by
Intro to vagrantIntro to vagrant
Intro to vagrantMantas Klasavicius
1.2K views45 slides
How To Set a Vagrant Development System by
How To Set a Vagrant Development SystemHow To Set a Vagrant Development System
How To Set a Vagrant Development SystemPaul Bearne
17.8K views27 slides
Introduction to Vagrant by
Introduction to VagrantIntroduction to Vagrant
Introduction to VagrantMarcelo Pinheiro
13.8K views37 slides
Vagrant presentation by
Vagrant presentationVagrant presentation
Vagrant presentationMahmudur Rahman
1K views18 slides
Vagrant-Overview by
Vagrant-OverviewVagrant-Overview
Vagrant-OverviewCrifkin
3.3K views18 slides
Vagrant by
VagrantVagrant
VagrantMichael Peacock
2K views114 slides

More Related Content

What's hot

Multi-provider Vagrant and Chef: AWS, VMware, and more by
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreChef Software, Inc.
16.5K views70 slides
It Works On My Machine: Vagrant for Software Development by
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentCarlos Perez
9.6K views35 slides
Vagrant 101 Workshop by
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 WorkshopLiora Milbaum
373 views25 slides
Create your very own Development Environment with Vagrant and Packer by
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
3.6K views67 slides
Vagrant for real by
Vagrant for realVagrant for real
Vagrant for realMichele Orselli
1.6K views81 slides
Vagrant to-aws-flow by
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flowKimberly Macias
9K views20 slides

What's hot(20)

Multi-provider Vagrant and Chef: AWS, VMware, and more by Chef Software, Inc.
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
Chef Software, Inc.16.5K views
It Works On My Machine: Vagrant for Software Development by Carlos Perez
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
Carlos Perez9.6K views
Create your very own Development Environment with Vagrant and Packer by frastel
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
frastel3.6K views
Vagrant step-by-step guide for Beginners by Sagar Acharya
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
Sagar Acharya2.2K views
Vagrant + Ansible + Docker by Vijay Selvaraj
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + Docker
Vijay Selvaraj2.5K views
Vagrant hands on workshop for beginners by Liora Milbaum
Vagrant hands on workshop for beginnersVagrant hands on workshop for beginners
Vagrant hands on workshop for beginners
Liora Milbaum633 views
Drupal VM for Drupal 8 Dev - MidCamp 2017 by Jeff Geerling
Drupal VM for Drupal 8 Dev - MidCamp 2017Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017
Jeff Geerling2K views
Automated Infrastructure and Application Management by Clark Everetts
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
Clark Everetts1.1K views
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ... by Sebastian Neubauer
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
6 Years of Docker: The Good, the Bad and Python Packaging at PyCon.DE&PyData ...
Sebastian Neubauer453 views
Vagrant - Version control your dev environment by bocribbz
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
bocribbz3.7K views
VCCW - Vagrant based WordPress development environment by Takayuki Miyauchi
VCCW - Vagrant based WordPress development environmentVCCW - Vagrant based WordPress development environment
VCCW - Vagrant based WordPress development environment

Viewers also liked

Vagrant For DevOps by
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOpsLalatendu Mohanty
10.5K views18 slides
Vagrant + Docker provider [+Puppet] by
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Nicolas Poggi
17.1K views29 slides
Dockerizing development workflow by
Dockerizing development workflowDockerizing development workflow
Dockerizing development workflowOrest Ivasiv
871 views22 slides
Vagrant or docker for java dev environment by
Vagrant or docker for java dev environmentVagrant or docker for java dev environment
Vagrant or docker for java dev environmentOrest Ivasiv
1.4K views34 slides
Vagrant for real codemotion (moar tips! ;-)) by
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Michele Orselli
1K views105 slides
Automate your Development Environment with Vagrant & Chef by
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef Michael Lihs
1.9K views29 slides

Viewers also liked(20)

Vagrant + Docker provider [+Puppet] by Nicolas Poggi
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]
Nicolas Poggi17.1K views
Dockerizing development workflow by Orest Ivasiv
Dockerizing development workflowDockerizing development workflow
Dockerizing development workflow
Orest Ivasiv871 views
Vagrant or docker for java dev environment by Orest Ivasiv
Vagrant or docker for java dev environmentVagrant or docker for java dev environment
Vagrant or docker for java dev environment
Orest Ivasiv1.4K views
Vagrant for real codemotion (moar tips! ;-)) by Michele Orselli
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
Michele Orselli1K views
Automate your Development Environment with Vagrant & Chef by Michael Lihs
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef
Michael Lihs1.9K views
Virtualization with Vagrant (ua.pycon 2011) by Dmitry Guyvoronsky
Virtualization with Vagrant (ua.pycon 2011)Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky1.6K views
Vagrant - ambiente de desenvolvimento virtualizado by Vinícius Krolow
Vagrant - ambiente de desenvolvimento virtualizadoVagrant - ambiente de desenvolvimento virtualizado
Vagrant - ambiente de desenvolvimento virtualizado
Vinícius Krolow1.3K views
Vagrant and docker by DuckDuckGo
Vagrant and dockerVagrant and docker
Vagrant and docker
DuckDuckGo396 views
Vagrant for real (codemotion rome 2016) by Michele Orselli
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
Michele Orselli43.9K views
Vagrant vs Docker by jchase50
Vagrant vs DockerVagrant vs Docker
Vagrant vs Docker
jchase508.8K views
Intro to containerization by Balint Pato
Intro to containerizationIntro to containerization
Intro to containerization
Balint Pato1.9K views
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩 by Wen-Tien Chang
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
Wen-Tien Chang35.2K views
Containerization is more than the new Virtualization: enabling separation of ... by Jérôme Petazzoni
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ... by Carlos Sanchez
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Carlos Sanchez34.6K views

Similar to Vagrant for Virtualized Development

Virtualizing Development by
Virtualizing DevelopmentVirtualizing Development
Virtualizing DevelopmentAdam Culp
1.5K views32 slides
Take home your very own free Vagrant CFML Dev Environment - Presented at dev.... by
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Gavin Pickin
539 views89 slides
Take Home Your Very Own Free Vagrant CFML Dev Environment by
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment ColdFusionConference
951 views89 slides
Ansible & Vagrant by
Ansible & VagrantAnsible & Vagrant
Ansible & VagrantMukul Malhotra
266 views11 slides
Vagrant are you still develop in a non-virtual environment- by
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-Anatoly Bubenkov
2.6K views22 slides
Puppet and Vagrant in development by
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
6.8K views29 slides

Similar to Vagrant for Virtualized Development(20)

Virtualizing Development by Adam Culp
Virtualizing DevelopmentVirtualizing Development
Virtualizing Development
Adam Culp1.5K views
Take home your very own free Vagrant CFML Dev Environment - Presented at dev.... by Gavin Pickin
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin539 views
Take Home Your Very Own Free Vagrant CFML Dev Environment by ColdFusionConference
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment
Vagrant are you still develop in a non-virtual environment- by Anatoly Bubenkov
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-
Anatoly Bubenkov2.6K views
Puppet and Vagrant in development by Adam Culp
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
Adam Culp6.8K views
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop by Walter Heck
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck613 views
Using Vagrant, Puppet, Testing & Hadoop by Puppet
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & Hadoop
Puppet5.7K views
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop by OlinData
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData718 views
Cooking Perl with Chef: Hello World Tutorial by David Golden
Cooking Perl with Chef: Hello World TutorialCooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World Tutorial
David Golden6.8K views
Create Development and Production Environments with Vagrant by Brian Hogan
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
Brian Hogan3.5K views
Automating with ansible (Part B) by iman darabi
Automating with ansible (Part B)Automating with ansible (Part B)
Automating with ansible (Part B)
iman darabi86 views
Puppet Provisioning Vagrant Virtual Machine by Arpit Aggarwal
Puppet Provisioning Vagrant Virtual MachinePuppet Provisioning Vagrant Virtual Machine
Puppet Provisioning Vagrant Virtual Machine
Arpit Aggarwal315 views
Varying wordpressdevelopmentenvironment wp-campus2016 by David Brattoli
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016
David Brattoli705 views
Using Vagrant by andygale
Using VagrantUsing Vagrant
Using Vagrant
andygale13.7K views
Linux containers and docker by Fabio Fumarola
Linux containers and dockerLinux containers and docker
Linux containers and docker
Fabio Fumarola1.9K views

More from Adam Culp

Hypermedia by
HypermediaHypermedia
HypermediaAdam Culp
651 views42 slides
Putting legacy to REST with middleware by
Putting legacy to REST with middlewarePutting legacy to REST with middleware
Putting legacy to REST with middlewareAdam Culp
2.2K views49 slides
php-1701-a by
php-1701-aphp-1701-a
php-1701-aAdam Culp
218 views50 slides
Release your refactoring superpower by
Release your refactoring superpowerRelease your refactoring superpower
Release your refactoring superpowerAdam Culp
217 views82 slides
Managing Technical Debt by
Managing Technical DebtManaging Technical Debt
Managing Technical DebtAdam Culp
216 views34 slides
Developing PHP Applications Faster by
Developing PHP Applications FasterDeveloping PHP Applications Faster
Developing PHP Applications FasterAdam Culp
484 views56 slides

More from Adam Culp(20)

Hypermedia by Adam Culp
HypermediaHypermedia
Hypermedia
Adam Culp651 views
Putting legacy to REST with middleware by Adam Culp
Putting legacy to REST with middlewarePutting legacy to REST with middleware
Putting legacy to REST with middleware
Adam Culp2.2K views
php-1701-a by Adam Culp
php-1701-aphp-1701-a
php-1701-a
Adam Culp218 views
Release your refactoring superpower by Adam Culp
Release your refactoring superpowerRelease your refactoring superpower
Release your refactoring superpower
Adam Culp217 views
Managing Technical Debt by Adam Culp
Managing Technical DebtManaging Technical Debt
Managing Technical Debt
Adam Culp216 views
Developing PHP Applications Faster by Adam Culp
Developing PHP Applications FasterDeveloping PHP Applications Faster
Developing PHP Applications Faster
Adam Culp484 views
Containing Quality by Adam Culp
Containing QualityContaining Quality
Containing Quality
Adam Culp224 views
Debugging elephpants by Adam Culp
Debugging elephpantsDebugging elephpants
Debugging elephpants
Adam Culp331 views
Zend expressive workshop by Adam Culp
Zend expressive workshopZend expressive workshop
Zend expressive workshop
Adam Culp1.7K views
Expressive Microservice Framework Blastoff by Adam Culp
Expressive Microservice Framework BlastoffExpressive Microservice Framework Blastoff
Expressive Microservice Framework Blastoff
Adam Culp1.6K views
Foundations of Zend Framework by Adam Culp
Foundations of Zend FrameworkFoundations of Zend Framework
Foundations of Zend Framework
Adam Culp975 views
Accidental professional by Adam Culp
Accidental professionalAccidental professional
Accidental professional
Adam Culp811 views
Build great products by Adam Culp
Build great productsBuild great products
Build great products
Adam Culp1K views
Does Your Code Measure Up? by Adam Culp
Does Your Code Measure Up?Does Your Code Measure Up?
Does Your Code Measure Up?
Adam Culp1.8K views
Practical PHP Deployment with Jenkins by Adam Culp
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with Jenkins
Adam Culp11.3K views
Refactoring Legacy Code by Adam Culp
Refactoring Legacy CodeRefactoring Legacy Code
Refactoring Legacy Code
Adam Culp4.3K views
Deprecated: Foundations of Zend Framework 2 by Adam Culp
Deprecated: Foundations of Zend Framework 2Deprecated: Foundations of Zend Framework 2
Deprecated: Foundations of Zend Framework 2
Adam Culp3.4K views
Clean application development tutorial by Adam Culp
Clean application development tutorialClean application development tutorial
Clean application development tutorial
Adam Culp8K views
Refactoring 101 by Adam Culp
Refactoring 101Refactoring 101
Refactoring 101
Adam Culp7.1K views
Essential git for developers by Adam Culp
Essential git for developersEssential git for developers
Essential git for developers
Adam Culp4.5K views

Recently uploaded

KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineShapeBlue
181 views19 slides
The Power of Heat Decarbonisation Plans in the Built Environment by
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built EnvironmentIES VE
69 views20 slides
DRBD Deep Dive - Philipp Reisner - LINBIT by
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBITShapeBlue
140 views21 slides
Network Source of Truth and Infrastructure as Code revisited by
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisitedNetwork Automation Forum
52 views45 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook PresentationRob McCarty
62 views27 slides
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericShapeBlue
88 views9 slides

Recently uploaded(20)

KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue181 views
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE69 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue140 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty62 views
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue88 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue163 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue253 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue94 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu365 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue144 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely78 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue176 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash153 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue222 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue166 views
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue by ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlueElevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
Elevating Privacy and Security in CloudStack - Boris Stoyanov - ShapeBlue
ShapeBlue179 views

Vagrant for Virtualized Development

  • 1. Vagrant for Virtualized Development By: Adam Culp Twitter: @adamculp https://joind.in/10538
  • 2. 2 Vagrant for Virtualized Development ● About me – PHP 5.3 Certified – Consultant at Zend Technologies – Organizer SoFloPHP (South Florida) – Organized SunshinePHP (Miami) – Long distance (ulramarathon) runner – Judo Black Belt Instructor
  • 3. 3 Vagrant for Virtualized Development ● Shortfalls of development environments – Does not mirror “testing” or “production” setup. – Each developer has a different one. ● Easily out of sync with standards ● Many versions of (php, mysql, apache, etc.) – Long ramp-up/training for new developers – It works for me!
  • 4. 4 Vagrant for Virtualized Development ● Vagrant - http://vagrantup.com – Virtualized development environments made easy ● Command line tool ● Lowers setup time ● Fully control entire environments and versions ● Eliminates “works on my machine” excuse ● Uses: – VirtualBox – VMWare – AWS – Others.... ● Can use Puppet or Chef ● FREE and open source
  • 5. 5 Vagrant for Virtualized Development ● Benefits of Using Vagrant – Solo Developers ● Maintain consistency across multiple projects. ● Can run multiple environments on a single host machine. (Dev., Test, Staging) ● Easily tear down and rebuild. – Teams ● Identical development environments. ● Consistent and portable. – Companies ● Easier onboarding of new talent. ● Build once and distribute to teams.
  • 6. 6 Vagrant for Virtualized Development ● Vagrant minimum requirements – VirtualBox and Hyper-V supported out of the box – Ruby – Vagrant ● Installers for MAC, Windows, various Linux ● Talks to VirtualBox and builds virtual machine based on a “base box”. – Chef or Puppet ● These require separate installation ● Enables setup and configuration of advanced services you may need in your environment.
  • 7. 7 Vagrant for Virtualized Development ● Vagrant Basic “How To” – Navigate (via terminal) to your project. – Find a base box: http://vagrantbox.es – Execute two simple commands: ● vagrant init ● vagrant up
  • 9. 9 Vagrant for Virtualized Development ● Vagrant Base Box Commands – Many base boxes available over the Internet, or you can create your own. ● Creation convention should be followed. – A base box must be added via local file or HTTP.
  • 10. 10 Vagrant for Virtualized Development ● Vagrant Base Box Commands – You can list current “installed” base boxes.
  • 11. 11 Vagrant for Virtualized Development ● Vagrant Base Box Commands – Or you can remove current base boxes. ● Remember to include provider.
  • 12. 12 Vagrant for Virtualized Development ● Vagrant Configuration File (Vagrantfile) – Simple Ruby code which typically contains a Vagrant configuration block. – First thing loaded by Vagrant. – Basic file created when 'init' is called from within a directory. – Add more options for more configuration.
  • 13. 13 Vagrant for Virtualized Development ● Sample Vagrantfile
  • 14. 14 Vagrant for Virtualized Development ● Suspend / Halt / Destroy – To shut down we can: ● “suspend” to save the current state of the machine. (does not return disk space, about 1GB) ● “halt” which is a graceful shutdown. ● “destroy” everything. (requires re-provision) – If we “suspended” to shut down last time you can use “vagrant resume” or “vagrant up” when returning, otherwise we use “vagrant up”.
  • 15. 15 Vagrant for Virtualized Development ● SSH – Vagrant makes SSH to the virtual machine easy from within the project directory. – Project files are available in the VM at '/vagrant' by default, but can be changed. – The VM has both read and write access to the shared folder. – Gain root (su) access use “sudo”.
  • 16. 16 Vagrant for Virtualized Development ● Port Forwarding – By default your host machine should be able to access the virtual machine by IP address. However, we need to activate port forwarding for services. – For HTTP: – Then we simply reload Vagrant. $ vagrant reload
  • 17. 17 Vagrant for Virtualized Development ● Provisioning – We can set up some provisioning automation in Vagrant by including a shell script. – Link to a shell script in the Vagrantfile.
  • 18. 18 Vagrant for Virtualized Development ● Sample Shell Script
  • 19. 19 Vagrant for Virtualized Development ● Packaging Your Own – Start with a Base Box ● Customize it as needed, unless relying solely on provisioning with Chef or Puppet. ● Run command to package $ vagrant package –vagrantfile Vagrantfile.pkg ● Creates 'package.box' in same directory. ● Distribute via raw file or via HTTP, for others. ● Other users can now use: $ vagrant box add my_box /path/to/the/package.box $ vagrant init my_box $ vagrant up
  • 20. 20 Vagrant for Virtualized Development ● Packaging Your Own (from scratch) – Simple enough to do. – Follow Vagrant standards, especially if you plan to share it. ● Set sizes of partition and RAM.(40GB/360MB) ● Set Domain and Hostname ● Create Vagrant user, and password. ● Create some groups ● Ruby, RubyGems, Puppet, Chef, SSH with public keys ● Set sudo permissions ● Create /vagrant directory
  • 21. 21 Vagrant for Virtualized Development ● Provisioning – Using Chef or Puppet we can create a script to alter the VM. ● Install apps ● Edit config files ● Many tasks needed to go from Base Box to desired environment. – Manifests (or recipe for Chef) ● Manifests sub-directory within project. ● Default.pp is the default file loaded.
  • 22. 22 Vagrant for Virtualized Development ● Advanced Capabilities of Vagrant – Many advanced topics available under Documentation on the Vagrant site. ● Modules within Manifests to encapsulate Puppet files. ● Create your own Base Boxes ● Multi-VM Environment ● Plugins ● NFS Shared Folders
  • 23. 23 Vagrant for Virtualized Development ● Puppet is: – Automation software ● Help system admins manage infrastructure. – Automates provisioning and configuration – Automate repetitive tasks – Ensure stability through consistency – Open source and commercial versions
  • 24. 24 Vagrant for Virtualized Development ● Puppet Supported Operating Systems: – RHEL – CentOS – Ubuntu – Debian – Scientific Linux – Oracle Linux – SUSE – Solaris – Windows
  • 25. 25 Vagrant for Virtualized Development ● Pieces – Modules for popular configurations – Compose application stack needed – Rollout to the node
  • 26. 26 Vagrant for Virtualized Development ● Puppet Training – Materials available on PuppetLabs site for FREE download. ● Learning Puppet Tutorial ● Learn Puppet VM to train on (VMWare or VirtualBox) ● Module cheatsheet ● Core types cheatsheet ● Users Guide ● Dashboard Manual
  • 27. 27 Vagrant for Virtualized Development ● New tool PuPHPet – Complex Vagrant setups made easy GUI. ● Puppet manifest creation ● Host (local, Digital Ocean, Rackspace). ● Ubuntu version. ● Set VM options. ● HTTP server. (Apache, Nginx) ● PHP version. (5.5, 5.4, 5.3) ● Or HHVM ● Debugger (Xdebug). ● Profiler (XHProf). ● Drush ● Database. (MySQL, PostgreSQL, MariaDB, MongoDB, Redis) ● Beantalkd or RabitMQ ● Elastic Search ● Create!
  • 28. 28 Vagrant for Virtualized Development ● New tool Rove.io – Complex Vagrant setups made easy GUI. ● Chef recipe creation ● Database. (various) ● Language. (Node.js, PHP, Python, Ruby) ● SCM (Git, Mercurial, Subversion) ● HTTP server (Apache, Nginx) ● Generate!
  • 29. 29 Vagrant for Virtualized Development ● Resources – http://vagrantup.com – http://puppetlabs.com – http://opscode.com/chef/ – http://virtualbox.org – http://puPHPet.com – http://getcomposer.org – http://github.com View details, slides, and rate at https://joind.in/10538
  • 30. ● Thank you Adam Culp http://www.geekyboy.com http://github.com/adamculp Twitter @adamculp View details, slides, and rate at https://joind.in/10538