SlideShare a Scribd company logo
1 of 13
Download to read offline
Defining testable Machine
Configurations with
Vagrant
30-40 minutes
Updated in June 2014 falmeida1988@gmail.com
What?
Vagrant is used for building reproducible and testable machine configurations.
In other words, coding your infrastructure.
You just define a base box (e.g. Ubuntu 12.04) and all configurations
(depending on your provider), packages to install and so on.
You install a VM provider (e.g. VirtualBox), run vagrant up and you’re good
to go.
Why?
● Machine configurations become a liability when you need to ensure your
software is correct (did it break because of your environment or because the
code is actually faulty?)
● It’s hard to make sure everyone in a team has the exact same machine setup.
● Sometimes it takes careful configuration to make something work and you want
to avoid having to do it for every new machine you work on.
● The need to be able to remotely configure (sometimes complex) infrastructures
in the cloud.
Who is it good for?
For those who:
● need to make sure their entire team has the exact same environment set
up so
● are responsible for configuring and setting up environments for others and
want to optimize the process;
● don’t want to waste time applying the same hacks or complex configuration
steps for each thew machine they use (common scenario).
Technical details
● Supported Hosts
○ Windows, Linux, MacOS
● Supported Guests
○ Everything *nix and Windows
● Supported Virtualization Providers
○ VirtualBox
○ VMWare (Workstation and Fusion)
○ Hyper V
○ AWS
○ Others (via plugins)
Your first Vagrantfile
This is a simple Vagrantfile that uses one of the most common boxes found
in VagrantCloud. You need to run vagrant box add
hashicorp/precise32 prior to running it.
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.provider "virtualbox" do |v|
v.gui = true
end
end
(This setup will get you a bare-bones Ubuntu 12.04 LTS Virtualbox machine.)
Basic Workflow
This is the simplest possible example of how to get from zero to sixty using Vagrant
(after you’ve installed Vagrant itself and a simple provider like VirtualBox).
● run vagrant box add to add a base box definition to your collection
● create a new directory
● cd into that directory and run vagrant init; this will create a blank
Vagrantfile in that directory
● edit said Vagrantfile adding options for your box (using one of the boxes
you’ve added via vagrant box add as base)
● run vagrant up
If there were no errors, you should have a new VirtualBox instance running (note that it may have no
GUI - you can use the Vagrantfiles shown in previous slides).
Basic provisioning
Provisioning just means installing packages and/or further configuring your
newly-created box.
For example, if you create an Ubuntu box, you might want to have Apache web
server installed beforehand:
Vagrant.configure(2) do |config|
# … other configurations
config.vm.provision "shell",inline: "apt-get update"
config.vm.provision "shell",inline: "apt-get install apache2 --assume-
yes"
end
Advanced provisioning
Vagrant supports a large number of third-party provisioners which can be used to
further configure your machine.
Some of the most commonly-used provisioners (apart from inline scripting as in the
previous slide) are as follows:
● Files (for example, to share environment between host and guest)
● Puppet
● Chef
● CFEngine
● Ansible
● Salt
Useful commands
● vagrant up - Creates a VM and starts it (or just start it if it’s already
installed)
● vagrant provision - Run any provisioning you might have set up for
the current box.
● vagrant reload - Restarts the VM taking into account modifications
made to Vagrantfile
● vagrant box list - Show all available boxes (i.e., boxes you have
added).
Heads-up I
● In order to use some useful commands like vagrant ssh (used to ssh
into your vagrant box), you need some unix commands (in this case, ssh).
This would seem to be an issue if you’re running Windows, but you have
many options here: some are Installing Git (it comes with a few utils) and
using Cygwin or MinGW.
● Starting from version 1.6, Vagrant has added full support for Windows
Guests. (Note that Support for Windows Hosts have been supported since
earlier versions.)
Heads-up II
● Most base (Linux) boxes have no Desktop Environment (like Gnome or
XFCE) installed by default. This means that, if you want to access your
Linux box via a GUI (menus and buttons), you have to install it yourself.
● (Setting v.gui = true in the config file does not install a Desktop
Environment for your VM!)
For a basic Ubuntu Virtualbox box with a GUI, see This bit of code on
GitHub.
References
● Official Vagrant Docs
● Summary of Commands
● Vagrant Provisioning

More Related Content

What's hot

Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantJoe Ferguson
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIHendrik Ebbers
 
Node js packages [#howto with npm]
Node js packages [#howto with npm]Node js packages [#howto with npm]
Node js packages [#howto with npm]Andrii Lundiak
 
OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...
OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...
OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...OpenNebula Project
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yumWalter Liu
 
Gestión de la configuración - Jenkins ci
Gestión de la configuración - Jenkins ciGestión de la configuración - Jenkins ci
Gestión de la configuración - Jenkins ciCarles San Agustin
 
Docker and fig for dev
Docker and fig for devDocker and fig for dev
Docker and fig for devpranas_algoteq
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechChristopher Bumgardner
 
Docker session III: Dockerfile
Docker session III: DockerfileDocker session III: Dockerfile
Docker session III: DockerfileDegendra Sivakoti
 
DevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentDevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentRob Reynolds
 
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngineOhio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngineNick Anderson
 
How Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project FeedbackHow Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project FeedbackNETWAYS
 
How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013 How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013 Maxence Dunnewind
 
Docker session II: Introduction to Docker
Docker session II: Introduction to DockerDocker session II: Introduction to Docker
Docker session II: Introduction to DockerDegendra Sivakoti
 
OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...
OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...
OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...OpenNebula Project
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundHendrik Ebbers
 
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...OpenNebula Project
 
Advanced microservices with .Net
Advanced microservices with .NetAdvanced microservices with .Net
Advanced microservices with .NetDon Schenck
 

What's hot (20)

Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with Vagrant
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
 
Node js packages [#howto with npm]
Node js packages [#howto with npm]Node js packages [#howto with npm]
Node js packages [#howto with npm]
 
OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...
OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...
OpenNebulaConf2017EU: Torturing OpenNebula for Fun and Profit by Carlo Daffar...
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yum
 
Gestión de la configuración - Jenkins ci
Gestión de la configuración - Jenkins ciGestión de la configuración - Jenkins ci
Gestión de la configuración - Jenkins ci
 
Docker and fig for dev
Docker and fig for devDocker and fig for dev
Docker and fig for dev
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
 
How to access your FIWARE Lab Instance.
How to access your FIWARE Lab Instance.How to access your FIWARE Lab Instance.
How to access your FIWARE Lab Instance.
 
Vagrant
VagrantVagrant
Vagrant
 
Docker session III: Dockerfile
Docker session III: DockerfileDocker session III: Dockerfile
Docker session III: Dockerfile
 
DevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentDevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day Development
 
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngineOhio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
Ohio Linux Fest 2013: Provisioning VMs Quickly with Vagrant and CFEngine
 
How Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project FeedbackHow Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project Feedback
 
How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013 How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013
 
Docker session II: Introduction to Docker
Docker session II: Introduction to DockerDocker session II: Introduction to Docker
Docker session II: Introduction to Docker
 
OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...
OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...
OpenNebulaConf2017EU: One (Windows) Image to Rule them All by Paul Batchelor,...
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
 
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
 
Advanced microservices with .Net
Advanced microservices with .NetAdvanced microservices with .Net
Advanced microservices with .Net
 

Similar to Define Testable Machine Configurations with Vagrant

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
Take Home Your Very Own Free Vagrant CFML Dev Environment ColdFusionConference
 
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....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Gavin Pickin
 
Automating with ansible (Part B)
Automating with ansible (Part B)Automating with ansible (Part B)
Automating with ansible (Part B)iman darabi
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Development with Vagrant
Development with VagrantDevelopment with Vagrant
Development with VagrantJohn Coggeshall
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 
Vagrant workshop 2015
Vagrant workshop 2015Vagrant workshop 2015
Vagrant workshop 2015Haifa Ftirich
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisationRadu Barbu
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 -  Working with Wercker WorksheetsOracle Developers APAC Meetup #1 -  Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 - Working with Wercker WorksheetsDarrel Chia
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerJulio Martinez
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized DevelopmentAdam Culp
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxmoirarandell
 
ITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and ChefITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and ChefOrtus Solutions, Corp
 

Similar to Define Testable Machine Configurations with Vagrant (20)

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
Take Home Your Very Own Free Vagrant CFML Dev Environment
 
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....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
Vagrantfordevops
VagrantfordevopsVagrantfordevops
Vagrantfordevops
 
Ansible & Vagrant
Ansible & VagrantAnsible & Vagrant
Ansible & Vagrant
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Keep calm and vagrant up
Keep calm and vagrant upKeep calm and vagrant up
Keep calm and vagrant up
 
Automating with ansible (Part B)
Automating with ansible (Part B)Automating with ansible (Part B)
Automating with ansible (Part B)
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Development with Vagrant
Development with VagrantDevelopment with Vagrant
Development with Vagrant
 
Vagrant
Vagrant Vagrant
Vagrant
 
Vagrant
VagrantVagrant
Vagrant
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
Vagrant workshop 2015
Vagrant workshop 2015Vagrant workshop 2015
Vagrant workshop 2015
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisation
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 -  Working with Wercker WorksheetsOracle Developers APAC Meetup #1 -  Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
 
ITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and ChefITB2015 - Winning with Vagrant, Puppet and Chef
ITB2015 - Winning with Vagrant, Puppet and Chef
 

More from Felipe

Aula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic taggingAula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic taggingFelipe
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFelipe
 
Word embeddings introdução, motivação e exemplos
Word embeddings  introdução, motivação e exemplosWord embeddings  introdução, motivação e exemplos
Word embeddings introdução, motivação e exemplosFelipe
 
Cloud Certifications - Overview
Cloud Certifications - OverviewCloud Certifications - Overview
Cloud Certifications - OverviewFelipe
 
Elasticsearch for Data Analytics
Elasticsearch for Data AnalyticsElasticsearch for Data Analytics
Elasticsearch for Data AnalyticsFelipe
 
Cloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and AlarmsCloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and AlarmsFelipe
 
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsCloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsFelipe
 
Online Machine Learning: introduction and examples
Online Machine Learning:  introduction and examplesOnline Machine Learning:  introduction and examples
Online Machine Learning: introduction and examplesFelipe
 
Aws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and toolsAws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and toolsFelipe
 
Exemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduceExemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduceFelipe
 
Pré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache SparkPré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache SparkFelipe
 
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...Felipe
 
Boas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de softwareBoas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de softwareFelipe
 
Rachinations
RachinationsRachinations
RachinationsFelipe
 
Ausgewählte preußische Tugenden
Ausgewählte preußische TugendenAusgewählte preußische Tugenden
Ausgewählte preußische TugendenFelipe
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play frameworkFelipe
 
Conceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de códigoConceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de códigoFelipe
 
DevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementDevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementFelipe
 
D3.js 30-minute intro
D3.js   30-minute introD3.js   30-minute intro
D3.js 30-minute introFelipe
 

More from Felipe (19)

Aula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic taggingAula rotulação automática - Automatic tagging
Aula rotulação automática - Automatic tagging
 
First steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with ExamplesFirst steps with Keras 2: A tutorial with Examples
First steps with Keras 2: A tutorial with Examples
 
Word embeddings introdução, motivação e exemplos
Word embeddings  introdução, motivação e exemplosWord embeddings  introdução, motivação e exemplos
Word embeddings introdução, motivação e exemplos
 
Cloud Certifications - Overview
Cloud Certifications - OverviewCloud Certifications - Overview
Cloud Certifications - Overview
 
Elasticsearch for Data Analytics
Elasticsearch for Data AnalyticsElasticsearch for Data Analytics
Elasticsearch for Data Analytics
 
Cloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and AlarmsCloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and Alarms
 
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsCloudwatch: Monitoring your AWS services with Metrics and Alarms
Cloudwatch: Monitoring your AWS services with Metrics and Alarms
 
Online Machine Learning: introduction and examples
Online Machine Learning:  introduction and examplesOnline Machine Learning:  introduction and examples
Online Machine Learning: introduction and examples
 
Aws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and toolsAws cost optimization: lessons learned, strategies, tips and tools
Aws cost optimization: lessons learned, strategies, tips and tools
 
Exemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduceExemplos de uso de apache spark usando aws elastic map reduce
Exemplos de uso de apache spark usando aws elastic map reduce
 
Pré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache SparkPré processamento de grandes dados com Apache Spark
Pré processamento de grandes dados com Apache Spark
 
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...
 
Boas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de softwareBoas práticas no desenvolvimento de software
Boas práticas no desenvolvimento de software
 
Rachinations
RachinationsRachinations
Rachinations
 
Ausgewählte preußische Tugenden
Ausgewählte preußische TugendenAusgewählte preußische Tugenden
Ausgewählte preußische Tugenden
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
 
Conceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de códigoConceitos e exemplos em versionamento de código
Conceitos e exemplos em versionamento de código
 
DevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementDevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration management
 
D3.js 30-minute intro
D3.js   30-minute introD3.js   30-minute intro
D3.js 30-minute intro
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Define Testable Machine Configurations with Vagrant

  • 1. Defining testable Machine Configurations with Vagrant 30-40 minutes Updated in June 2014 falmeida1988@gmail.com
  • 2. What? Vagrant is used for building reproducible and testable machine configurations. In other words, coding your infrastructure. You just define a base box (e.g. Ubuntu 12.04) and all configurations (depending on your provider), packages to install and so on. You install a VM provider (e.g. VirtualBox), run vagrant up and you’re good to go.
  • 3. Why? ● Machine configurations become a liability when you need to ensure your software is correct (did it break because of your environment or because the code is actually faulty?) ● It’s hard to make sure everyone in a team has the exact same machine setup. ● Sometimes it takes careful configuration to make something work and you want to avoid having to do it for every new machine you work on. ● The need to be able to remotely configure (sometimes complex) infrastructures in the cloud.
  • 4. Who is it good for? For those who: ● need to make sure their entire team has the exact same environment set up so ● are responsible for configuring and setting up environments for others and want to optimize the process; ● don’t want to waste time applying the same hacks or complex configuration steps for each thew machine they use (common scenario).
  • 5. Technical details ● Supported Hosts ○ Windows, Linux, MacOS ● Supported Guests ○ Everything *nix and Windows ● Supported Virtualization Providers ○ VirtualBox ○ VMWare (Workstation and Fusion) ○ Hyper V ○ AWS ○ Others (via plugins)
  • 6. Your first Vagrantfile This is a simple Vagrantfile that uses one of the most common boxes found in VagrantCloud. You need to run vagrant box add hashicorp/precise32 prior to running it. Vagrant.configure(2) do |config| config.vm.box = "hashicorp/precise32" config.vm.provider "virtualbox" do |v| v.gui = true end end (This setup will get you a bare-bones Ubuntu 12.04 LTS Virtualbox machine.)
  • 7. Basic Workflow This is the simplest possible example of how to get from zero to sixty using Vagrant (after you’ve installed Vagrant itself and a simple provider like VirtualBox). ● run vagrant box add to add a base box definition to your collection ● create a new directory ● cd into that directory and run vagrant init; this will create a blank Vagrantfile in that directory ● edit said Vagrantfile adding options for your box (using one of the boxes you’ve added via vagrant box add as base) ● run vagrant up If there were no errors, you should have a new VirtualBox instance running (note that it may have no GUI - you can use the Vagrantfiles shown in previous slides).
  • 8. Basic provisioning Provisioning just means installing packages and/or further configuring your newly-created box. For example, if you create an Ubuntu box, you might want to have Apache web server installed beforehand: Vagrant.configure(2) do |config| # … other configurations config.vm.provision "shell",inline: "apt-get update" config.vm.provision "shell",inline: "apt-get install apache2 --assume- yes" end
  • 9. Advanced provisioning Vagrant supports a large number of third-party provisioners which can be used to further configure your machine. Some of the most commonly-used provisioners (apart from inline scripting as in the previous slide) are as follows: ● Files (for example, to share environment between host and guest) ● Puppet ● Chef ● CFEngine ● Ansible ● Salt
  • 10. Useful commands ● vagrant up - Creates a VM and starts it (or just start it if it’s already installed) ● vagrant provision - Run any provisioning you might have set up for the current box. ● vagrant reload - Restarts the VM taking into account modifications made to Vagrantfile ● vagrant box list - Show all available boxes (i.e., boxes you have added).
  • 11. Heads-up I ● In order to use some useful commands like vagrant ssh (used to ssh into your vagrant box), you need some unix commands (in this case, ssh). This would seem to be an issue if you’re running Windows, but you have many options here: some are Installing Git (it comes with a few utils) and using Cygwin or MinGW. ● Starting from version 1.6, Vagrant has added full support for Windows Guests. (Note that Support for Windows Hosts have been supported since earlier versions.)
  • 12. Heads-up II ● Most base (Linux) boxes have no Desktop Environment (like Gnome or XFCE) installed by default. This means that, if you want to access your Linux box via a GUI (menus and buttons), you have to install it yourself. ● (Setting v.gui = true in the config file does not install a Desktop Environment for your VM!) For a basic Ubuntu Virtualbox box with a GUI, see This bit of code on GitHub.
  • 13. References ● Official Vagrant Docs ● Summary of Commands ● Vagrant Provisioning