SlideShare a Scribd company logo
Vagrant & Devops
What is Vagrant?
● Syntactic sugar around VMs
○
○
○
○
○
○

Virtualbox
VMWare
LXC
AWS
Rackspace
etc
What is Vagrant?
● Syntactic sugar around provisioning
○
○
○
○
○
○

Chef
Puppet
Ansible
Salt
Scripts (bash, etc)
etc
What is Vagrant?
● Five commands
○
○
○
○
○

vagrant up
vagrant provision
vagrant ssh
vagrant halt
vagrant destroy

● Really more like 16 commands (v1.4.3)
○ You really only use the first 5.
It’s just Ruby
● Runs on Windows, Linux, OSX
● Use all the programming constructs
○ loops
○ variables
○ etc

● Check the environment
○ Great for working with Jenkins

● Bring in modules
It’s just a configuration file
● You’re building a configuration file
○ Actions don’t happen immediately

● The Vagrant engine is intuitive
○ (usually)
require 'vagrant-vbguest'
max_memory = 4 * 1024 # This is in megabytes
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb, override|
override.vm.box = "precise64"
override.vm.box_url = "http://some.place.com/some/path.box"
vb.customize ["modifyvm", :id, "--memory", max_memory]
end
end
require ‘vagrant-lxc’
max_memory = 4 * 1024 # This is in megabytes
Vagrant.configure("2") do |config|
config.vm.provider :lxc do |lxc, override|
override.vm.box = "precise64"
override.vm.box_url = "http://some.otherplace.com/some/path.box"
lxc.customize 'cgroup.memory.limit_in_bytes', "#{max_memory}M"
end
end
require 'vagrant-vbguest'
require ‘vagrant-lxc’
max_memory = 4 * 1024 # This is in megabytes
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb, override|
….
end
config.vm.provider :lxc do |lxc, override|
….
end
end
Provider details
● Provider is specified in “vagrant up”
○ Other commands detect the provider

● There are dozens of providers
○ Virtualbox, VMWare, LXC, Docker
○ AWS, Joyent, Rackspace, DigitalOcean
○ OpenStack, Parallels

● Writing your own isn’t all that hard
○ Prior art is very helpful, as is mailing list and IRC
Shared Folders
● By default, the folder with the Vagrantfile is
shared into /vagrant
○ Can be changed

● Can add more shared folders
○ The provisioners already do this

● For cloud VMs, “shared” means “rsync’ed on
demand”.
Vagrant.configure("2") do |config|
chefdir = ‘.’
config.vm.provision :chef_solo do |chef|
chef.roles_path = “#{chefdir}/roles”
chef.run_list.clear
chef.add_role "container"
end
end
Vagrant.configure("2") do |config|
chefdir = ‘devops/chef’
config.vm.provision :chef_solo do |chef|
chef.roles_path = “#{chefdir}/roles”
chef.run_list.clear
chef.add_role "container"
end
end
Vagrant.configure("2") do |config|
config.vm.provision :shell,
inline: “some bash code here”
config.vm.provision :shell,
path: “path/to/script” # Must be relative to Vagrantfile directory
end
Provisioner details
● When they are declared matters.
○ If one fails, the remainder will not run.

● Can mix-and-match
○ Normally one chef/puppet/etc and several shell
Multiple VMs
● Can launch 1-N VMs
○ Each VM must have a unique name

● Each VM can have a different:
○ provider
○ set of provisioners
○ configuration, including:
■ network interface
Vagrant.configure("2") do |config|
config.vm.define “web” do |web|
web.vm.provision ‘shell’, inline: “echo “web” > /etc/vagrant_purpose”
web.vm.provider :chef-solo do |chef|
end
end
config.vm.define “database” do |database|
database.vm.provision ‘shell’, inline: “echo “database” > /etc/vagrant_purpose”
database.vm.provider :puppet do |puppet|
end
end
end
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb, override|
...
end
(‘web’, ‘database’).each do |name|
config.vm.define name do |machine|
machine.vm.provision ‘shell’, inline: “echo “#{name}” > /etc/vagrant_purpose”
end
end
end
So what?
● This isn’t just another cool tool.
● Sometimes, all you need is simpler controls.
○ Everything has always been possible, just most
things are too expensive to build.
Clone production
● Dev and QA should be clones of Prod
○ Prod doesn’t run on a single server
○ So, why does QA and Dev?
Setup load-testing
● Use a cloud provider (AWS, etc)
● A Vagrantfile that has:
○ Your production structure
○ Your load-testing systems (Tsung, JMeter, etc)

● Running a load test is now just:
○ vagrant up
○ vagrant ssh load1 -c “/vagrant/bin/run_load_test.sh”
Jenkins and Testing
● Testing should be in a clone of Production
○ The best clone is what you’ll build Production from

● Jenkins can integrate with Vagrant
○ vagrant up
○ vagrant ssh -c “/vagrant/bin/run_tests.sh”
■ This will return the exit code properly
Vagrant.configure("2") do |config|
# Configure the AWS provider here
NUM = # Figure out how many instances to run
(1 .. NUM).each do |index|
config.vm.define “test#{index}” do |test|
test.vm.provision ‘shell’, inline: “echo “test#{index}” > /etc/vagrant_purpose”
test.vm.provider :aws do |aws|
aws.tags = { ‘Name’ => “#{aws.tags[‘Name’]}-test#{index}” }
end
end
end
end
Automate Golden Images
$ vagrant up --provider=aws
$ ec2-create-image 
`cat .vagrant/machines/default/aws/id` 
--name “my_new_ami”
$ vagrant destroy -f
Putting it all together (A Crazy Idea)
● Let developers manage server changes
○ Chef cookbooks for a project are checked into that
project’s repository
○ Developers can make changes
○ Vagrant lets them test out changes in a clone of
production
○ Devops participates in code reviews (as needed)
■ Devops has veto over changes to devops/
directory and code.
Putting it all together (A Crazy Idea)
● Devops is no longer responsible for:
○ Server changes

● Devops IS responsible for:
○ Validating proposed server changes
○ Ensuring the pipeline for server changes
○ Training the developers to own their server changes

● Job changes
○ Build the engine instead of pulling the rickshaw
Questions?
Rob Kinyon
rob.kinyon@gmail.com
rkinyon on Twitter
robkinyon on IRC
Ad

More Related Content

What's hot (20)

Npm: beyond 'npm i'
Npm: beyond 'npm i'Npm: beyond 'npm i'
Npm: beyond 'npm i'
Pieter Herroelen
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
Soshi Nemoto
 
Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containers
Marian Marinov
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
Kim Chee Leong
 
Trust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker ContainersTrust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker Containers
Nan Liu
 
CI and CD
CI and CDCI and CD
CI and CD
Ladislav Prskavec
 
A Deeper Look at Cargo
A Deeper Look at CargoA Deeper Look at Cargo
A Deeper Look at Cargo
Anton Weiss
 
SockJS Intro
SockJS IntroSockJS Intro
SockJS Intro
Ngoc Dao
 
Angular2 ecosystem
Angular2 ecosystemAngular2 ecosystem
Angular2 ecosystem
Kamil Lelonek
 
Automation m ysql_and_customer_photo
Automation m ysql_and_customer_photoAutomation m ysql_and_customer_photo
Automation m ysql_and_customer_photo
Manju Kb
 
Ansible
AnsibleAnsible
Ansible
gnosek
 
Solving some of the scalability problems at booking.com
Solving some of the scalability problems at booking.comSolving some of the scalability problems at booking.com
Solving some of the scalability problems at booking.com
Ivan Kruglov
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Codemotion
 
Npm scripts
Npm scriptsNpm scripts
Npm scripts
정윤 김
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
William Yeh
 
WebSockets with PHP: Mission impossible
WebSockets with PHP: Mission impossibleWebSockets with PHP: Mission impossible
WebSockets with PHP: Mission impossible
Yoan-Alexander Grigorov
 
Nginx وب سروری برای تمام فصول
Nginx وب سروری برای تمام فصولNginx وب سروری برای تمام فصول
Nginx وب سروری برای تمام فصول
efazati
 
Server side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPServer side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHP
Marc Gear
 
A complete guide to Node.js
A complete guide to Node.jsA complete guide to Node.js
A complete guide to Node.js
Prabin Silwal
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
Soshi Nemoto
 
Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containers
Marian Marinov
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
Kim Chee Leong
 
Trust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker ContainersTrust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker Containers
Nan Liu
 
A Deeper Look at Cargo
A Deeper Look at CargoA Deeper Look at Cargo
A Deeper Look at Cargo
Anton Weiss
 
SockJS Intro
SockJS IntroSockJS Intro
SockJS Intro
Ngoc Dao
 
Automation m ysql_and_customer_photo
Automation m ysql_and_customer_photoAutomation m ysql_and_customer_photo
Automation m ysql_and_customer_photo
Manju Kb
 
Ansible
AnsibleAnsible
Ansible
gnosek
 
Solving some of the scalability problems at booking.com
Solving some of the scalability problems at booking.comSolving some of the scalability problems at booking.com
Solving some of the scalability problems at booking.com
Ivan Kruglov
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Codemotion
 
Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點Ansible 實戰:top down 觀點
Ansible 實戰:top down 觀點
William Yeh
 
Nginx وب سروری برای تمام فصول
Nginx وب سروری برای تمام فصولNginx وب سروری برای تمام فصول
Nginx وب سروری برای تمام فصول
efazati
 
Server side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPServer side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHP
Marc Gear
 
A complete guide to Node.js
A complete guide to Node.jsA complete guide to Node.js
A complete guide to Node.js
Prabin Silwal
 

Similar to Vagrant (20)

Vagrant
Vagrant Vagrant
Vagrant
Akshay Siwal
 
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-
Vagrant are you still develop in a non-virtual environment-
Anatoly Bubenkov
 
Vagrant 의 활용
Vagrant 의 활용Vagrant 의 활용
Vagrant 의 활용
InHwan Chun
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
Antons Kranga
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
bocribbz
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
andygale
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
Crifkin
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantDevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Felipe
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
Lalatendu Mohanty
 
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
 
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
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
Kris Buytaert
 
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
Hendrik Ebbers
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
Mantas Klasavicius
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
Dave Pitts
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
Antons Kranga
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
Michael Lihs
 
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
Brian Hogan
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
Dockerized maven
Dockerized mavenDockerized maven
Dockerized maven
Matthias Bertschy
 
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-
Vagrant are you still develop in a non-virtual environment-
Anatoly Bubenkov
 
Vagrant 의 활용
Vagrant 의 활용Vagrant 의 활용
Vagrant 의 활용
InHwan Chun
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
Antons Kranga
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
bocribbz
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
andygale
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
Crifkin
 
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantDevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Felipe
 
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
 
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
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
Kris Buytaert
 
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
Hendrik Ebbers
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
Dave Pitts
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
Antons Kranga
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
Michael Lihs
 
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
Brian Hogan
 
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG DortmundVagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
Ad

Recently uploaded (20)

Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Ad

Vagrant

  • 2. What is Vagrant? ● Syntactic sugar around VMs ○ ○ ○ ○ ○ ○ Virtualbox VMWare LXC AWS Rackspace etc
  • 3. What is Vagrant? ● Syntactic sugar around provisioning ○ ○ ○ ○ ○ ○ Chef Puppet Ansible Salt Scripts (bash, etc) etc
  • 4. What is Vagrant? ● Five commands ○ ○ ○ ○ ○ vagrant up vagrant provision vagrant ssh vagrant halt vagrant destroy ● Really more like 16 commands (v1.4.3) ○ You really only use the first 5.
  • 5. It’s just Ruby ● Runs on Windows, Linux, OSX ● Use all the programming constructs ○ loops ○ variables ○ etc ● Check the environment ○ Great for working with Jenkins ● Bring in modules
  • 6. It’s just a configuration file ● You’re building a configuration file ○ Actions don’t happen immediately ● The Vagrant engine is intuitive ○ (usually)
  • 7. require 'vagrant-vbguest' max_memory = 4 * 1024 # This is in megabytes Vagrant.configure("2") do |config| config.vm.provider :virtualbox do |vb, override| override.vm.box = "precise64" override.vm.box_url = "http://some.place.com/some/path.box" vb.customize ["modifyvm", :id, "--memory", max_memory] end end
  • 8. require ‘vagrant-lxc’ max_memory = 4 * 1024 # This is in megabytes Vagrant.configure("2") do |config| config.vm.provider :lxc do |lxc, override| override.vm.box = "precise64" override.vm.box_url = "http://some.otherplace.com/some/path.box" lxc.customize 'cgroup.memory.limit_in_bytes', "#{max_memory}M" end end
  • 9. require 'vagrant-vbguest' require ‘vagrant-lxc’ max_memory = 4 * 1024 # This is in megabytes Vagrant.configure("2") do |config| config.vm.provider :virtualbox do |vb, override| …. end config.vm.provider :lxc do |lxc, override| …. end end
  • 10. Provider details ● Provider is specified in “vagrant up” ○ Other commands detect the provider ● There are dozens of providers ○ Virtualbox, VMWare, LXC, Docker ○ AWS, Joyent, Rackspace, DigitalOcean ○ OpenStack, Parallels ● Writing your own isn’t all that hard ○ Prior art is very helpful, as is mailing list and IRC
  • 11. Shared Folders ● By default, the folder with the Vagrantfile is shared into /vagrant ○ Can be changed ● Can add more shared folders ○ The provisioners already do this ● For cloud VMs, “shared” means “rsync’ed on demand”.
  • 12. Vagrant.configure("2") do |config| chefdir = ‘.’ config.vm.provision :chef_solo do |chef| chef.roles_path = “#{chefdir}/roles” chef.run_list.clear chef.add_role "container" end end
  • 13. Vagrant.configure("2") do |config| chefdir = ‘devops/chef’ config.vm.provision :chef_solo do |chef| chef.roles_path = “#{chefdir}/roles” chef.run_list.clear chef.add_role "container" end end
  • 14. Vagrant.configure("2") do |config| config.vm.provision :shell, inline: “some bash code here” config.vm.provision :shell, path: “path/to/script” # Must be relative to Vagrantfile directory end
  • 15. Provisioner details ● When they are declared matters. ○ If one fails, the remainder will not run. ● Can mix-and-match ○ Normally one chef/puppet/etc and several shell
  • 16. Multiple VMs ● Can launch 1-N VMs ○ Each VM must have a unique name ● Each VM can have a different: ○ provider ○ set of provisioners ○ configuration, including: ■ network interface
  • 17. Vagrant.configure("2") do |config| config.vm.define “web” do |web| web.vm.provision ‘shell’, inline: “echo “web” > /etc/vagrant_purpose” web.vm.provider :chef-solo do |chef| end end config.vm.define “database” do |database| database.vm.provision ‘shell’, inline: “echo “database” > /etc/vagrant_purpose” database.vm.provider :puppet do |puppet| end end end
  • 18. Vagrant.configure("2") do |config| config.vm.provider :virtualbox do |vb, override| ... end (‘web’, ‘database’).each do |name| config.vm.define name do |machine| machine.vm.provision ‘shell’, inline: “echo “#{name}” > /etc/vagrant_purpose” end end end
  • 19. So what? ● This isn’t just another cool tool. ● Sometimes, all you need is simpler controls. ○ Everything has always been possible, just most things are too expensive to build.
  • 20. Clone production ● Dev and QA should be clones of Prod ○ Prod doesn’t run on a single server ○ So, why does QA and Dev?
  • 21. Setup load-testing ● Use a cloud provider (AWS, etc) ● A Vagrantfile that has: ○ Your production structure ○ Your load-testing systems (Tsung, JMeter, etc) ● Running a load test is now just: ○ vagrant up ○ vagrant ssh load1 -c “/vagrant/bin/run_load_test.sh”
  • 22. Jenkins and Testing ● Testing should be in a clone of Production ○ The best clone is what you’ll build Production from ● Jenkins can integrate with Vagrant ○ vagrant up ○ vagrant ssh -c “/vagrant/bin/run_tests.sh” ■ This will return the exit code properly
  • 23. Vagrant.configure("2") do |config| # Configure the AWS provider here NUM = # Figure out how many instances to run (1 .. NUM).each do |index| config.vm.define “test#{index}” do |test| test.vm.provision ‘shell’, inline: “echo “test#{index}” > /etc/vagrant_purpose” test.vm.provider :aws do |aws| aws.tags = { ‘Name’ => “#{aws.tags[‘Name’]}-test#{index}” } end end end end
  • 24. Automate Golden Images $ vagrant up --provider=aws $ ec2-create-image `cat .vagrant/machines/default/aws/id` --name “my_new_ami” $ vagrant destroy -f
  • 25. Putting it all together (A Crazy Idea) ● Let developers manage server changes ○ Chef cookbooks for a project are checked into that project’s repository ○ Developers can make changes ○ Vagrant lets them test out changes in a clone of production ○ Devops participates in code reviews (as needed) ■ Devops has veto over changes to devops/ directory and code.
  • 26. Putting it all together (A Crazy Idea) ● Devops is no longer responsible for: ○ Server changes ● Devops IS responsible for: ○ Validating proposed server changes ○ Ensuring the pipeline for server changes ○ Training the developers to own their server changes ● Job changes ○ Build the engine instead of pulling the rickshaw