SF DevOps: Introducing Vagrant

4,954 views

Published on

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,954
On SlideShare
0
From Embeds
0
Number of Embeds
1,564
Actions
Shares
0
Downloads
0
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

SF DevOps: Introducing Vagrant

  1. 1. Vagrant
  2. 2. Mitchell Hashimoto@mitchellh
  3. 3. VagrantWith a focus on Ops
  4. 4. Agenda
  5. 5. AgendaWhat is Vagrant
  6. 6. Agenda What is VagrantWhy use Vagrant
  7. 7. Agenda What is Vagrant Why use VagrantDevOps with Vagrant in mind
  8. 8. VagrantWhat is Vagrant?
  9. 9. The Grid
  10. 10. A tool for building and distributing virtualized environments.
  11. 11. A local cloud.
  12. 12. Create and tear down virtual machines
  13. 13. Create and tear down virtual machinesUse automation to provision and configure
  14. 14. Create and tear down virtual machinesUse automation to provision and configure Network multiple virtual machines
  15. 15. Create and tear down virtual machinesUse automation to provision and configure Network multiple virtual machines Package and distribute VM images
  16. 16. VagrantWhy use Vagrant?
  17. 17. User space Browser Editor Queue Other Music Server Server Web DB App IRC IM Server Server Server Operating System
  18. 18. No isolation
  19. 19. No isolationNo repeatability
  20. 20. No isolationNo repeatability No verification
  21. 21. User space Virtualized OS Browser Editor Web App DB Server Server Server IRC IM Operating System
  22. 22. Isolation
  23. 23. IsolationMirror production
  24. 24. Isolation Mirror productionTest Ops scripts with a free server
  25. 25. Isolation Mirror productionTest Ops scripts with a free server Faster onboarding
  26. 26. Isolation Mirror productionTest Ops scripts with a free server Faster onboarding Designers can do it, too!
  27. 27. VagrantDevOps
  28. 28. Goal: DevelopCookbooks/Modules to run in a VM and production.
  29. 29. Little extra effort. Big gain.Good practices.
  30. 30. Little extra effort. Big gain.Good practices.
  31. 31. Don’t assume EC2/RackSpace/MyCloudInc# Allow app servers to access DB-A INPUT -p tcp -s <%= node[:ec2][:local_ipv4] %> --dport <%= node[:mysql][:port] %> -j ACCEPT
  32. 32. Don’t assume EC2/RackSpace/MyCloudInc# Allow app servers to access DB-A INPUT -p tcp -s <%= local_ip(node) %> --dport <%= node[:mysql][:port] %> -j ACCEPT
  33. 33. Don’t assume EC2/RackSpace/MyCloudInc# Returns the local-network IP of a node# based on the environment.def local_ip(node) return “127.0.0.1” if in_vagrant? return node[:ec2][:local_ipv4] if in_ec2? raise “Unknown server environment.”end
  34. 34. Short-circuit Recipes/ManifestsINFO: Chef Run complete in 1442.890442 secondsINFO: Running report handlersINFO: Report handlers complete
  35. 35. Short-circuit Recipes/Manifests# Only install certain software when not# in Vagrant.if !in_vagrant? include_recipe “flume::node” include_recipe “kiip_monitoring::client” ...end
  36. 36. Short-circuit Recipes/ManifestsINFO: Chef Run complete in 946.418511 secondsINFO: Running report handlersINFO: Report handlers complete Not great, but I’ll take 50% speedups.
  37. 37. Flexible Configurationattributes = { :kiip_mongo => { :mount_ebs => false }, :kiip_web => { :app_source => "folder" }, ...}
  38. 38. Role Compositionrun_list => [ “role[base]”, “role[kiip_mongodb]”, “role[kiip_memcached]”, “role[kiip_web]”, “role[kiip_utility]”] Normally different servers. But no problem on one!
  39. 39. DevOps Zen
  40. 40. VagrantIs it battle tested?
  41. 41. vagrantup.comgithub.com/mitchellh/vagrant

×