SlideShare a Scribd company logo
1 of 45
Download to read offline
and
STUFF
* Vagrant is a tool for creating,
managing and distributing
portable development
environments.
* Wrapper around a variety of virtual machine
providers.
* Single command that uniformly creates,
provisions, destroys, and connects to machines
* Replicate and rebuild whole VM instantly
* Open source tool.
* Works on Mac OS X, Windows
and Linux
Zero to VM in Seconds
* Vagrant up
Main Concepts
‘vagrant’ cliBoxes Vagrantfile
vagrant reads a Vagrantfile
and builds a machine based
on a template called box.
Boxes
* Template from which machines are created.
* Contains pre –installed OS
* Boxes managed with vagrant command line
Boxes
* Many publically available
- http://www.vagrantbox.es/
- https://vagrantcloud.com/discover/featured
- https://github.com/jedi4ever/veewee/tree/master/templates
* Can be custom build
- vagrant package --base <vm name>
* Preinstalled with specific software
- Veewee
- Packer
Packer
http://www.packer.io/
Created by Hashicorp
Some functionality overlaps with Vagrant
Useful with Vagrant
some-os-distro.iso → distro.box
Packer templates
h"ps://www.google.lt/search?q=packer+templates	
  
	
  
h"ps://github.com/monai/packer-­‐templates	
  
	
  
Vagrantfile
* Per-project configuration file read by
vagrant.
* Describe machine properties, software to
be provisioned, network, etc…
* Simple Ruby based DSL
Vagrantfile
example
VAGRANTFILE_API_VERSION	
  =	
  "2"	
  
	
  
Vagrant.configure(VAGRANTFILE_API_VERSION)	
  do	
  |config|	
  
	
  
	
  	
  config.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  config.vm.host_name	
  =	
  'test77v1.dev1.adform.com'	
  
	
  
	
  	
  config.vm.provider	
  "virtualbox"	
  do	
  |vm|	
  
	
  
	
  	
  	
  	
  vm.customize	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "modifyvm",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :id,	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐memory",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2048",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐cpus",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]	
  
	
  	
  end	
  
end	
  
Vagrantfile cli
•  Manages entire lifecycle of the dev environments
•  $ vagrant …
Vagrantfile cli
Vagrant up
Vagrant ssh
Vagrant destroy
Vagrantfile cli
Vagrant init
Vagrant box
Vagrant suspend
Vagrant halt
Vagrant plugin
Vagrant package
https://docs.vagrantup.com/v2/cli/index.html
Features
ProvisioningSynced
Folders Networking
Multi
machine
Providers Plugins
Providers
A provider manages compute resources for virtual machines
Allows to use the right provider for the different environment
Providers
VAGRANTFILE_API_VERSION	
  =	
  "2"	
  
	
  
Vagrant.configure(VAGRANTFILE_API_VERSION)	
  do	
  |config|	
  
	
  
	
  	
  config.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  config.vm.host_name	
  =	
  'test77v1.dev1.adform.com'	
  
	
  
	
  	
  config.vm.provider	
  "virtualbox"	
  do	
  |vm|	
  
	
  
	
  	
  	
  	
  vm.customize	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "modifyvm",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :id,	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐memory",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2048",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐cpus",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]	
  
	
  	
  end	
  
end	
  
Providers
$	
  vagrant	
  box	
  list	
  
$	
  vagrant	
  box	
  add	
  <name>	
  <url>	
  
$	
  vagrant	
  up	
  -­‐-­‐provider=<name>
Synced Folders
Automaticaly syncs folders from host to guest
Types: VirtualBox, Rsync, SMB, NFS, Etc.,
Default: Vagrant will share your project
directory (the directory with the Vagrantfile)
to /vagrant
Synced Folders
VAGRANTFILE_API_VERSION	
  =	
  "2"	
  
	
  
Vagrant.configure(VAGRANTFILE_API_VERSION)	
  do	
  |config|	
  
	
  
	
  	
  config.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  config.vm.host_name	
  =	
  'test77v1.dev1.adform.com’	
  
	
  	
  config.vm.synced_folder	
  "data",	
  "/tutorial"	
  
	
  
	
  	
  config.vm.provider	
  "virtualbox"	
  do	
  |vm|	
  
	
  	
  	
  	
  vm.customize	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "modifyvm",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :id,	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐memory",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2048",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐cpus",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]	
  
	
  	
  end	
  
end	
  
Networking
Forwarded Ports - basically NAT
Private Network - Host-only networking
Public Network - Bridged Networking
You can use mix and match – couple of those together or
couple of one
Networking
VAGRANTFILE_API_VERSION	
  =	
  "2"	
  
	
  
Vagrant.configure(VAGRANTFILE_API_VERSION)	
  do	
  |config|	
  
	
  
	
  	
  config.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  config.vm.host_name	
  =	
  'test77v1.dev1.adform.com’	
  
	
  	
  config.vm.synced_folder	
  "data",	
  "/tutorial”	
  
	
  config.vm.network	
  "forwarded_port",	
  guest:	
  80,	
  host:	
  8080	
  
	
  config.vm.network	
  "private_network",	
  ip:	
  "172.16.0.11"	
  
	
  
	
  	
  config.vm.provider	
  "virtualbox"	
  do	
  |vm|	
  
	
  	
  	
  	
  vm.customize	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "modifyvm",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :id,	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐memory",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2048",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "-­‐-­‐cpus",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "2"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]	
  
	
  	
  end	
  
end	
  
Provisioning
Install required software as part of ‘vagrant up’
Supports: Shell, Ansible, Docker, Puppet, Salt
Provisioning
Puppet apply
VAGRANTFILE_API_VERSION	
  =	
  "2"	
  
	
  
Vagrant.configure(VAGRANTFILE_API_VERSION)	
  do	
  |config|	
  
	
  
	
  	
  config.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  config.vm.host_name	
  =	
  'test77v1.dev1.adform.com’	
  
…	
  
	
  	
  config.vm.provider	
  "virtualbox"	
  do	
  |vm|	
  
…	
  	
  	
  
	
  	
  config.vm.provision	
  "puppet"	
  do	
  |puppet|	
  
	
  	
  	
  	
  puppet.manifests_path	
  =	
  "puppet/manifests"	
  
	
  	
  	
  	
  puppet.module_path	
  	
  	
  	
  =	
  "puppet/modules"	
  
	
  	
  	
  	
  puppet.manifest_file	
  	
  =	
  "site.pp"	
  
	
  	
  end	
  
end	
  
Provisioning
Puppet agent
VAGRANTFILE_API_VERSION	
  =	
  "2"	
  
	
  
Vagrant.configure(VAGRANTFILE_API_VERSION)	
  do	
  |config|	
  
	
  
	
  	
  config.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  config.vm.host_name	
  =	
  'test77v1.dev1.adform.com’	
  
…	
  
	
  	
  config.vm.provider	
  "virtualbox"	
  do	
  |vm|	
  
…	
  	
  	
  
	
  config.vm.provision	
  "shell",	
  inline:	
  "sudo	
  /usr/bin/puppet	
  agent	
  -­‐-­‐verbose	
  –onekme	
  	
  
–no-­‐daemonize	
  -­‐-­‐server	
  puppetmaster.adform.com	
  -­‐-­‐wailorcert	
  60	
  -­‐-­‐environment	
  noenv"	
  
	
  
	
  	
  config.vm.provision	
  "puppet_server"	
  do	
  |puppet|	
  
	
  	
  	
  	
  puppet.puppet_server	
  =	
  "puppetmaster.adform.com"	
  
	
  	
  	
  	
  puppet.opkons	
  	
  	
  	
  	
  	
  	
  =	
  ['-­‐-­‐test',	
  '-­‐-­‐configkmeout	
  1200']	
  
	
  	
  end	
  
end	
  
Multi machine
Manage multi-machine cluster with a single Vagrantfile
Vagrant.configure(VAGRANTFILE_API_VERSION)	
  do	
  |config|	
  
	
  	
  	
  	
  	
  	
  config.vm.define	
  "node1"	
  do	
  |node1|	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node1.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node1.vm.host_name	
  =	
  'node1.test.com'	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node1.vm.provider	
  "virtualbox"	
  do	
  |vb|	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  vb.customize	
  ["modifyvm",	
  :id,	
  "-­‐-­‐memory",	
  "2048"]	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  end	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node1.vm.network	
  "private_network",	
  ip:	
  "172.16.0.11"	
  
	
  	
  	
  	
  	
  	
  end	
  
	
  	
  	
  	
  	
  config.vm.define	
  "node2"	
  do	
  |node2|	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node2.vm.box	
  =	
  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node2.vm.host_name	
  =	
  'node2.test.com'	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node2.vm.provider	
  "virtualbox"	
  do	
  |vb|	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  vb.gui	
  =	
  true	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  vb.customize	
  ["modifyvm",	
  :id,	
  "-­‐-­‐memory",	
  "1048"]	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  end	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  node2.vm.network	
  "private_network",	
  ip:	
  "172.16.0.21"	
  
	
  	
  	
  	
  	
  end	
  
end	
  
Plugins
Extensions. Lots of them!
https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Plugins
$	
  vagrant	
  plugin	
  install	
  vagrant-­‐aws	
  
$ vagrant up --provider=aws
Vagrant Cloud
Vagrant
Share
Box
Distribution
Discover
Boxes
Download/Install
h"ps://www.vagrantup.com/downloads	
  
Docker
* Linux Only
* Open Source
* uses LinuX Containers (LXC)
* run in the same operating system as its host.
* uses AuFS for the file system
Docker vs VMs
Docker vs VMs
Full Issolation
Resources guaranteed
Size: 1GB VM x # VMs
Performance: overhead
Minutes to start
Need conversion
Less Issolation
No guaranteed resources
Size: 1GB ( little over J)
Performance: no overhead
Seconds to start
Portable
Docker
portable
Docker vs VMs
full isolation with guaranteed resources => VMs
isolate processes from each other and want to
run a ton of them => LXS
Dockeron Windows& MAC
Docker
Hello World
$	
  docker	
  run	
  -­‐d	
  ubuntu:14.04	
  /bin/sh	
  -­‐c	
  "while	
  true;	
  do	
  echo	
  hello	
  world;	
  sleep	
  1;	
  done”	
  
	
  
$	
  docker	
  ps	
  
$ docker	
  logs	
  <name>	
  
Docker
CLI
$	
  docker	
  run	
  -­‐d	
  -­‐P	
  training/webapp	
  python	
  app.py	
  
Docker
Cli
$	
  docker	
  run	
  
$	
  docker	
  ps	
  
$	
  docker	
  logs	
  
$	
  docker	
  stop	
  
$	
  docker	
  a"ach	
  
$	
  docker	
  images	
  
$	
  docker	
  search	
  
$	
  docker	
  pull	
  
$	
  docker	
  top	
  
$	
  docker	
  inspect	
  
…	
  
Docker
Dockerfile
FROM	
  	
  	
  	
  	
  	
  	
  	
  ubuntu:12.10	
  
RUN	
  	
  	
  	
  	
  	
  	
  	
  	
  apt-­‐get	
  update	
  
RUN	
  	
  	
  	
  	
  	
  	
  	
  	
  apt-­‐get	
  -­‐y	
  install	
  redis-­‐server	
  
EXPOSE	
  	
  	
  	
  	
  	
  6379	
  
ENTRYPOINT	
  	
  ["/usr/bin/redis-­‐server"]	
  
Docker
Cli
$	
  docker	
  build	
  -­‐t	
  adform/redis	
  <path_to_dir>	
  
	
  
$	
  docker	
  run	
  -­‐-­‐name	
  redis	
  -­‐d	
  <your	
  username>/redis	
  
Docker
With Vagrant
DEMO
$	
  vagrant	
  up	
  -­‐-­‐provider=docker	
  	
  -­‐-­‐no-­‐parallel

More Related Content

What's hot

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
Christopher Bumgardner
 

What's hot (20)

It Works On My Machine: Vagrant for Software Development
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
 
Vagrant
VagrantVagrant
Vagrant
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
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
 
Vagrant vs Docker
Vagrant vs DockerVagrant vs Docker
Vagrant vs Docker
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 Workshop
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
Beyond Puppet
Beyond PuppetBeyond Puppet
Beyond Puppet
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]
 
Create your very own Development Environment with Vagrant and Packer
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
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Vagrant hands on workshop for beginners
Vagrant hands on workshop for beginnersVagrant hands on workshop for beginners
Vagrant hands on workshop for beginners
 
Vagrant and CentOS 7
Vagrant and CentOS 7Vagrant and CentOS 7
Vagrant and CentOS 7
 
Building (localized) Vagrant boxes with Packer
Building (localized) Vagrant boxes with PackerBuilding (localized) Vagrant boxes with Packer
Building (localized) Vagrant boxes with Packer
 
An Introduction to Vagrant and Docker
An Introduction to Vagrant and DockerAn Introduction to Vagrant and Docker
An Introduction to Vagrant and Docker
 
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
 
Meetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioMeetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.io
 
Vagrant + Ansible + Docker
Vagrant + Ansible + DockerVagrant + Ansible + Docker
Vagrant + Ansible + Docker
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
 
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
 

Viewers also liked

Network vs. Code Metrics to Predict Defects: A Replication Study
Network vs. Code Metrics  to Predict Defects: A Replication StudyNetwork vs. Code Metrics  to Predict Defects: A Replication Study
Network vs. Code Metrics to Predict Defects: A Replication Study
Kim Herzig
 
Adform webinar: New Features
Adform webinar: New FeaturesAdform webinar: New Features
Adform webinar: New Features
AdformMarketing
 

Viewers also liked (20)

Infrastructure as Code @BuildStuff2013
Infrastructure as Code @BuildStuff2013Infrastructure as Code @BuildStuff2013
Infrastructure as Code @BuildStuff2013
 
Adform case: from 0 to business metrics(Zabbix conference 2012) 2012.09.21
Adform case: from 0 to business metrics(Zabbix conference 2012) 2012.09.21Adform case: from 0 to business metrics(Zabbix conference 2012) 2012.09.21
Adform case: from 0 to business metrics(Zabbix conference 2012) 2012.09.21
 
Logs management
Logs managementLogs management
Logs management
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
File Commands Of Linux Ii
File Commands Of Linux  IiFile Commands Of Linux  Ii
File Commands Of Linux Ii
 
Vijai
VijaiVijai
Vijai
 
South Florida HDI Virtual Event: IT Alignment and Value Network Metrics
South Florida HDI Virtual Event:  IT Alignment and Value Network MetricsSouth Florida HDI Virtual Event:  IT Alignment and Value Network Metrics
South Florida HDI Virtual Event: IT Alignment and Value Network Metrics
 
Network vs. Code Metrics to Predict Defects: A Replication Study
Network vs. Code Metrics  to Predict Defects: A Replication StudyNetwork vs. Code Metrics  to Predict Defects: A Replication Study
Network vs. Code Metrics to Predict Defects: A Replication Study
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
 
Vagrant, como usar para desenvolvimento PHP
Vagrant, como usar para desenvolvimento PHPVagrant, como usar para desenvolvimento PHP
Vagrant, como usar para desenvolvimento PHP
 
Vagrant - ambiente de desenvolvimento virtualizado
Vagrant - ambiente de desenvolvimento virtualizadoVagrant - ambiente de desenvolvimento virtualizado
Vagrant - ambiente de desenvolvimento virtualizado
 
Adform webinar: New Features
Adform webinar: New FeaturesAdform webinar: New Features
Adform webinar: New Features
 
Zabbix Performance Tuning
Zabbix Performance TuningZabbix Performance Tuning
Zabbix Performance Tuning
 
Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Se...
Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Se...Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Se...
Microservices Practitioner Summit Jan '15 - Scaling Uber from 1 to 100s of Se...
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Zabbix Performance Tuning
Zabbix Performance TuningZabbix Performance Tuning
Zabbix Performance Tuning
 
Storm - SpaaS
Storm - SpaaSStorm - SpaaS
Storm - SpaaS
 
Application Networks: Microservices and APIs at Netflix
Application Networks: Microservices and APIs at NetflixApplication Networks: Microservices and APIs at Netflix
Application Networks: Microservices and APIs at Netflix
 
Microservices at Spotify
Microservices at SpotifyMicroservices at Spotify
Microservices at Spotify
 
Introduction to Zabbix - Company, Product, Services and Use Cases
Introduction to Zabbix - Company, Product, Services and Use CasesIntroduction to Zabbix - Company, Product, Services and Use Cases
Introduction to Zabbix - Company, Product, Services and Use Cases
 

Similar to Intro to vagrant

Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Acquia
 

Similar to Intro to vagrant (20)

Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Tech Talk - Vagrant
Tech Talk - VagrantTech Talk - Vagrant
Tech Talk - Vagrant
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)Virtualization with Vagrant (ua.pycon 2011)
Virtualization with Vagrant (ua.pycon 2011)
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
NetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16xNetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16x
 
Vagrant 의 활용
Vagrant 의 활용Vagrant 의 활용
Vagrant 의 활용
 
Vagrant
VagrantVagrant
Vagrant
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with Vagrant
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Intro to vagrant

  • 2. * Vagrant is a tool for creating, managing and distributing portable development environments.
  • 3. * Wrapper around a variety of virtual machine providers. * Single command that uniformly creates, provisions, destroys, and connects to machines * Replicate and rebuild whole VM instantly
  • 4.
  • 5. * Open source tool. * Works on Mac OS X, Windows and Linux
  • 6. Zero to VM in Seconds * Vagrant up
  • 8. vagrant reads a Vagrantfile and builds a machine based on a template called box.
  • 9. Boxes * Template from which machines are created. * Contains pre –installed OS * Boxes managed with vagrant command line
  • 10. Boxes * Many publically available - http://www.vagrantbox.es/ - https://vagrantcloud.com/discover/featured - https://github.com/jedi4ever/veewee/tree/master/templates * Can be custom build - vagrant package --base <vm name> * Preinstalled with specific software - Veewee - Packer
  • 11. Packer http://www.packer.io/ Created by Hashicorp Some functionality overlaps with Vagrant Useful with Vagrant some-os-distro.iso → distro.box
  • 12. Packer templates h"ps://www.google.lt/search?q=packer+templates     h"ps://github.com/monai/packer-­‐templates    
  • 13. Vagrantfile * Per-project configuration file read by vagrant. * Describe machine properties, software to be provisioned, network, etc… * Simple Ruby based DSL
  • 14. Vagrantfile example VAGRANTFILE_API_VERSION  =  "2"     Vagrant.configure(VAGRANTFILE_API_VERSION)  do  |config|        config.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"      config.vm.host_name  =  'test77v1.dev1.adform.com'        config.vm.provider  "virtualbox"  do  |vm|            vm.customize  [                                        "modifyvm",                    :id,                                          "-­‐-­‐memory",                    "2048",                                        "-­‐-­‐cpus",                        "2"                                    ]      end   end  
  • 15. Vagrantfile cli •  Manages entire lifecycle of the dev environments •  $ vagrant …
  • 16. Vagrantfile cli Vagrant up Vagrant ssh Vagrant destroy
  • 17. Vagrantfile cli Vagrant init Vagrant box Vagrant suspend Vagrant halt Vagrant plugin Vagrant package https://docs.vagrantup.com/v2/cli/index.html
  • 19. Providers A provider manages compute resources for virtual machines Allows to use the right provider for the different environment
  • 20. Providers VAGRANTFILE_API_VERSION  =  "2"     Vagrant.configure(VAGRANTFILE_API_VERSION)  do  |config|        config.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"      config.vm.host_name  =  'test77v1.dev1.adform.com'        config.vm.provider  "virtualbox"  do  |vm|            vm.customize  [                                        "modifyvm",                    :id,                                          "-­‐-­‐memory",                    "2048",                                        "-­‐-­‐cpus",                                  "2"                                    ]      end   end  
  • 21. Providers $  vagrant  box  list   $  vagrant  box  add  <name>  <url>   $  vagrant  up  -­‐-­‐provider=<name>
  • 22. Synced Folders Automaticaly syncs folders from host to guest Types: VirtualBox, Rsync, SMB, NFS, Etc., Default: Vagrant will share your project directory (the directory with the Vagrantfile) to /vagrant
  • 23. Synced Folders VAGRANTFILE_API_VERSION  =  "2"     Vagrant.configure(VAGRANTFILE_API_VERSION)  do  |config|        config.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"      config.vm.host_name  =  'test77v1.dev1.adform.com’      config.vm.synced_folder  "data",  "/tutorial"        config.vm.provider  "virtualbox"  do  |vm|          vm.customize  [                                        "modifyvm",                    :id,                                          "-­‐-­‐memory",                    "2048",                                        "-­‐-­‐cpus",                                  "2"                                    ]      end   end  
  • 24. Networking Forwarded Ports - basically NAT Private Network - Host-only networking Public Network - Bridged Networking You can use mix and match – couple of those together or couple of one
  • 25. Networking VAGRANTFILE_API_VERSION  =  "2"     Vagrant.configure(VAGRANTFILE_API_VERSION)  do  |config|        config.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"      config.vm.host_name  =  'test77v1.dev1.adform.com’      config.vm.synced_folder  "data",  "/tutorial”    config.vm.network  "forwarded_port",  guest:  80,  host:  8080    config.vm.network  "private_network",  ip:  "172.16.0.11"        config.vm.provider  "virtualbox"  do  |vm|          vm.customize  [                                        "modifyvm",                    :id,                                          "-­‐-­‐memory",                    "2048",                                        "-­‐-­‐cpus",                                  "2"                                    ]      end   end  
  • 26. Provisioning Install required software as part of ‘vagrant up’ Supports: Shell, Ansible, Docker, Puppet, Salt
  • 27. Provisioning Puppet apply VAGRANTFILE_API_VERSION  =  "2"     Vagrant.configure(VAGRANTFILE_API_VERSION)  do  |config|        config.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"      config.vm.host_name  =  'test77v1.dev1.adform.com’   …      config.vm.provider  "virtualbox"  do  |vm|   …          config.vm.provision  "puppet"  do  |puppet|          puppet.manifests_path  =  "puppet/manifests"          puppet.module_path        =  "puppet/modules"          puppet.manifest_file    =  "site.pp"      end   end  
  • 28. Provisioning Puppet agent VAGRANTFILE_API_VERSION  =  "2"     Vagrant.configure(VAGRANTFILE_API_VERSION)  do  |config|        config.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"      config.vm.host_name  =  'test77v1.dev1.adform.com’   …      config.vm.provider  "virtualbox"  do  |vm|   …        config.vm.provision  "shell",  inline:  "sudo  /usr/bin/puppet  agent  -­‐-­‐verbose  –onekme     –no-­‐daemonize  -­‐-­‐server  puppetmaster.adform.com  -­‐-­‐wailorcert  60  -­‐-­‐environment  noenv"        config.vm.provision  "puppet_server"  do  |puppet|          puppet.puppet_server  =  "puppetmaster.adform.com"          puppet.opkons              =  ['-­‐-­‐test',  '-­‐-­‐configkmeout  1200']      end   end  
  • 29. Multi machine Manage multi-machine cluster with a single Vagrantfile Vagrant.configure(VAGRANTFILE_API_VERSION)  do  |config|              config.vm.define  "node1"  do  |node1|                          node1.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"                          node1.vm.host_name  =  'node1.test.com'                          node1.vm.provider  "virtualbox"  do  |vb|                                      vb.customize  ["modifyvm",  :id,  "-­‐-­‐memory",  "2048"]                          end                          node1.vm.network  "private_network",  ip:  "172.16.0.11"              end            config.vm.define  "node2"  do  |node2|                        node2.vm.box  =  "MantasK/centos-­‐6.5-­‐x86_64-­‐puppet"                        node2.vm.host_name  =  'node2.test.com'                        node2.vm.provider  "virtualbox"  do  |vb|                                    vb.gui  =  true                                  vb.customize  ["modifyvm",  :id,  "-­‐-­‐memory",  "1048"]                        end                        node2.vm.network  "private_network",  ip:  "172.16.0.21"            end   end  
  • 30. Plugins Extensions. Lots of them! https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Plugins $  vagrant  plugin  install  vagrant-­‐aws   $ vagrant up --provider=aws
  • 33.
  • 34. Docker * Linux Only * Open Source * uses LinuX Containers (LXC) * run in the same operating system as its host. * uses AuFS for the file system
  • 36. Docker vs VMs Full Issolation Resources guaranteed Size: 1GB VM x # VMs Performance: overhead Minutes to start Need conversion Less Issolation No guaranteed resources Size: 1GB ( little over J) Performance: no overhead Seconds to start Portable
  • 38. Docker vs VMs full isolation with guaranteed resources => VMs isolate processes from each other and want to run a ton of them => LXS
  • 40. Docker Hello World $  docker  run  -­‐d  ubuntu:14.04  /bin/sh  -­‐c  "while  true;  do  echo  hello  world;  sleep  1;  done”     $  docker  ps   $ docker  logs  <name>  
  • 41. Docker CLI $  docker  run  -­‐d  -­‐P  training/webapp  python  app.py  
  • 42. Docker Cli $  docker  run   $  docker  ps   $  docker  logs   $  docker  stop   $  docker  a"ach   $  docker  images   $  docker  search   $  docker  pull   $  docker  top   $  docker  inspect   …  
  • 43. Docker Dockerfile FROM                ubuntu:12.10   RUN                  apt-­‐get  update   RUN                  apt-­‐get  -­‐y  install  redis-­‐server   EXPOSE            6379   ENTRYPOINT    ["/usr/bin/redis-­‐server"]  
  • 44. Docker Cli $  docker  build  -­‐t  adform/redis  <path_to_dir>     $  docker  run  -­‐-­‐name  redis  -­‐d  <your  username>/redis  
  • 45. Docker With Vagrant DEMO $  vagrant  up  -­‐-­‐provider=docker    -­‐-­‐no-­‐parallel