virtualization for developers

Download Virtualization for Developers

Post on 28-Jun-2015




0 download

Embed Size (px)


The rise of virtualization has transformed the server business, but other than that it seems like the developer world has largely been left behind. Regardless of if you are working on one project, or have 20 clients, every developer should know how to use virtualization to create seamless and easy to manage development environments. In this talk we will take a practical approach to using a combination of puppet, vagrant, and virtualbox to create entire development environments in a matter of moments - and even better re-use that template for any project you have in the future in a version-controlled and easily managed manner. Bringing on a new developer for your project? We'll show you how they can get a full-fledged development environment from zero to working in under 10 minutes.


  • 1. John Coggeshall @coogle

2. A bit about me Involved with PHP since1996 Author of tidy extension Published Author of many PHP texts 3. Virtualization for you, the developer Creating fully encapsulated development environments Fully Version Controlled Available locally using free tools or deploy to EC2 asnecessaryThe technologies we are going to discuss Vagrant Bootstrap virtual machines, manage boxsettings, etc. VirtualBox Provides the actual VM environment for machine Puppet Provisions box, installs and manages various software, code, etc. (also supports others such as Chef, shell scripts, etc.) 4. There are a lot of reasons to use VMs for development Keep your host machine clean / easily recover fromcorruption Keep separate projects from stepping on each other Super easy developer on-boardingThere are even more reasons to use Vagrant & Puppet Much easier management of the stack, versions, etc. Allows seamless deployment to various environmentsfor testing 5. To get started, youre going to need to download two pieces of software Vagrant - VirtualBox - are builds available for all major platforms 6. Step 1: Download the tools Step 2: Define your VM parameters Step 3: Build your puppet manifests Step 4: Prosper 7. Every repository should have a Vagrantfile in the root directory that defines the VM itself Ruby based, but no Ruby knowledge requiredDefines a few key aspects of your initial VM configuration Base VM type used (various available) Network configuration for VM in relation to host machine Provisioning tooling used (i.e. puppet) VM resource limits (memory, etc)Different configurations can be defined for different environments, and propagated throughout the process 8. Once the VM has been defined vagrant can boot it up as a headless VM (no display) using VirtualBox automatically and configure it as necessary Once booted, it can then provision the box by installing software packages, shared paths with hosts, etc. as necessary through the use of provisioning tools like puppet Next step is defining your puppet manifests 9. With everything defined, one command takes care of it all! Downloads the VirtualBox image if necessary(precise64) Boots the VM with the defined parameters (memory, network, etc) Sets of shared folders, copies puppet manifests as necessary and executes puppet to run those manifests 10. vagrant up Brings up the virtual machine vagrant halt Halts the VM (poweroff) vagrant destroy Destroys the VM entirely vagrant provision Run puppet provisioning again vagrant ssh automagically log into the VM via SSH 11. Primarily Vagrant is used to build local VMs for development But Vagrant can also be used to deploy to other environments, such as AWS through the use of Vagrant plug-insFirst, install the Vagrant AWS provider plug-in: 12. Next, you will need to add a new environment to your Vagrantfile to setup the necessary configuration values for AWS such as Key/Secret, AMI type, etc. Note: To do provisioning using puppet, you may need to bootstrap the AMI on boot to install the puppet tooling To boot, simply add the --provider option to vagrant up 13. A single Vagrantfile can define multiple VMs (multi-machine environments) useful for all sorts of things: A web server and database server API client and server Etc.Vagrant can do more than just VirtualBox as well, through providers can also provide VMWareVMs, etc. 14. Vagrantfile configuration files can be created at various levels, and will be merged together to define/override settings Box itself (precise64) Home directory (~/.vagrant.d) Project directory 15. Thank you for coming! Questions? If you loved the talk, please login to and rate me! (If you hated the talk, please anonymously troll me) Reading:


View more >