Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant w/ Japanese Subtitle in 2013

Vagrant w/ Japanese Subtitle in 2013

Yohei Yasukawa

August 10, 2013
Tweet

More Decks by Yohei Yasukawa

Other Decks in Technology

Transcript

  1. A tool for creating, managing, and distributing portable development environments.

    Vagrant ͱ͸ɼ࠶ݱՄೳͳ։ൃ؀ڥΛ؆୯ʹ ߏஙɾ؅ཧɾ഑෍͢ΔͨΊͷπʔϧͰ͢
  2. $ vagrant init precise32 \ http://files.vagrantup.com/precise32.box ... $ vagrant up

    ... $ vagrant ssh vagrant@precise64:~$ echo hello hello Zero to VM in Seconds Vagrant Λ࢖͏ͱɼ΄Μͷ਺ίϚϯυͰ ։ൃ༻ͷԾ૝ϚγϯΛ্ཱͪ͛Δ͜ͱ͕Ͱ͖·͢
  3. “You’re hired! Get the site up and running on that

    new laptop.” ʮ܅Λ࠾༻͢ΔΑʂ͊͞ɼ͜ͷ৽͍͠ϥοϓτοϓͰ؀ڥߏஙΛͯ͠ ϩʔΧϧ؀ڥͰ΢ΣϒαΠτΛ্ཱͪ͛ͯ͘Εͨ·͑ɽʯ ͜Μͳͱ͖ɼ͋ͳͨͳΒͲ͏͠·͔͢ʁ
  4. facebook_killer → ./setup.sh Installing some server... Installing some software... Configuring

    it all... Successful sacrifice made to deity. ྫ͑͹ɼ͜Μͳײ͡ͷεΫϦϓτͰ͢
  5. Your Mac is not what is running in production. ʮ͋ͳͨͷ

    Mac ͸ϓϩμΫγϣϯ؀ڥͰ͸ͳ͍ʯ ͱ͍͏໰୊Ͱ͢
  6. Unlikely that all the software you need will work the

    same on your machine. શͯͷιϑτ΢ΣΞ͕ ͋ͳͨͱಉ͡؀ڥͰಈ͍͍ͯΔΘ͚Ͱ͸ͳ͍ͷͰ͢
  7. What if people want to work in Windows? Linux? ྫ͑͹ɼWindows

    Ͱಈ͔͍ͨ͠৔߹͸ʁ ͋Δ͍͸ɼLinux Ͱಈ͔͍ͨ͠৔߹͸Ͳ͏ͳΔͰ͠ΐ͏͔ʁ
  8. facebook_killer → ruby main.rb Failed to connect to MySQL at

    localhost:3306 ࣮ߦͯ͠Έ͚ͨͲɼʮMySQL ͕ແ͍ʯͱౖΒΕͨ (#ƅДƅ)
  9. facebook_killer → ruby main.rb Failed to connect to Redis at

    localhost:6379! ࠓ౓͸ Redis ͕ແ͔ͬͨΑ ʘ(^o^)ʗ
  10. Before: 1. Work on ops scripts 2. Spin up server

    3. Test 4. Repeat ྫ͑͹ɼ1) ίʔυΛॻ͖ɼ2) αʔόΛىಈͤ͞ɼ 3) ςετ͢Δɼͱ͍͏ૢ࡞Λ܁Γฦ͍ͯͨ͠ͱ͠·͠ΐ͏
  11. Imagine waiting 30 minutes until you could see the effects

    of your code change. ίʔυΛมߋͯ͠΋ɼͦͷ݁ՌΛ֬ೝ͢ΔͨΊʹ ̏̌෼΋଴ͨ͞ΕΔΑ͏ͳঢ়گΛߟ͑ͯΈ͍ͯͩ͘͞
  12. Dev, Test, Prod. All the same ops scripts on the

    same OS. ·ͨɼVagrant Ͱ͸ɼ։ൃ/ςετ/ຊ൪؀ڥʹରͯ͠ ͦΕͧΕಉ͡ૢ࡞Λಉ͡OSͰ࣮ߦ͢Δ͜ͱ͕Ͱ͖·͢
  13. Subtle differences from the artisanal developer workstation ops cause pain.

    ৬ਓܳతʹ࠷దԽ͞Εͨ։ൃ؀ڥ͸, ͦͷ؀ڥΛ࠶ݱ͢ΔͨΊͷίετΛੜΈ·͢
  14. Ops does what they do best for the entire organization.

    ݁Ռͱͯ͠ɼ։ൃ؀ڥΛ࠷దԽͤͯ͞΋ શͯͷ؀ڥͰͦͷԸܙΛ͏͚Δ͜ͱ͕Ͱ͖·͢
  15. Mature, stable, proven. Development since Jan 2010. Used by thousands

    of companies. 2010೥1݄͔Β։ൃ͕ελʔτ͠ɼطʹे෼ʹ҆ఆ͍ͯ͠·͢ ·ͨɼଟ͘ͷஶ໊ͳاۀͰ΋࣮ࡍʹ࢖ΘΕ͍ͯ·͢
  16. Create and Manage Virtualized Development Environments Mitchell Hashimoto Vagrant Up

    and Running http://oreilly.com/go/vagrant ͪͳΈʹɼΦϥΠϦʔ͔Β΋ Vagrant ͷຊ͕ग़൛͞Ε͍ͯ·͢
  17. Tao of Vagrant The Power is in the Workflow Vagrant

    Ͱܝ͍͛ͯΔେ͖ͳ໨ඪ͸ ʮ࠷ߴͷ։ൃϑϩʔʯΛఏڙ͢Δ͜ͱͰ͢
  18. Developers 1. Check out any project. 2. “vagrant up” 3.

    Done. Vagrant ͕޿͘ීٴ͢Ε͹ɼͦΕ͕ͲΜͳϓϩδΣΫτͰ͋Ε 1) μ΢ϯϩʔυ͠ɼ2) `vagrant up`ͱ࣮ߦ͢Δ͚ͩͰಈ͔ͤΔΑ͏ʹͳΓ·͢
  19. Developers Continue to work in your own browsers, editors, and

    other tools. ݁Ռͱͯ͠ɼ։ൃऀ͸։ൃ؀ڥʹറΒΕΔ͜ͱແ͘, ͓޷Έͷϒϥ΢β΍ΤσΟλͳͲΛ࢖͑ΔΑ͏ʹͳΓ·͢
  20. Developers The existence of Vagrant is transparent and unimportant. Vagrant

    is just the workhorse that creates consistent and stable development environments. Vagrant ͸ɼۭؾͷΑ͏ͳଘࡏʹͳΔ͜ͱΛ໨ࢦ͍ͯ͠·͢. ͨͩͻͨ͢ΒʹҰ؏ੑͱ҆ఆੑͷ͋Δ։ൃ؀ڥΛ௥ڀ͠·͢.
  21. Systems Operations 1. “vagrant up” 2. Complete sandbox to test

    ops scripts. γεςϜ؅ཧऀ͸ɼͨͩ `vagrant up`ͱ࣮ߦ͢Δ͚ͩͰ, ࣗ༝ʹςετͰ͖Δ؀ڥΛखʹೖΕΔ͜ͱ͕Ͱ͖·͢
  22. Systems Operations Automation developed used for both production and development.

    ͦͯ͠ɼ৽ͨʹՃ͑ͨมߋ͸ɼࣗಈԽ͞Ε, ։ൃ؀ڥʹ΋ຊ൪؀ڥʹ΋ద༻Ͱ͖ΔΑ͏ʹͳΓ·͢
  23. Systems Operations With every vagrant up, developers get a fully

    provisioned environment using the same scripts as production. ͜ͷͨΊɼ։ൃऀ͸ `vagrant up` ͱ࣮ߦ͢Δ౓ʹ มߋ͕Ճ͑ΒΕͨ৽ͨͳ؀ڥΛखʹೖΕΔ͜ͱ͕Ͱ͖·͢
  24. Clean up with vagrant destroy, vagrant suspend, or vagrant halt.

    ·ͨɼ΋͠։ൃ్தͰ։ൃ؀ڥʹ৽͍͠มߋ͕Ճ͑ΒΕͯ΋, `vagrant [destroy|suspend|halt]` ͱ࣮ߦ͢Ε͹؆୯ʹ։ൃ؀ڥΛࣺͯΒΕ·͢
  25. vagrant up will get you up and running at any

    moment. ͦͷޙɼ`vagrant up` ͱ࣮ߦ͢Δ͚ͩͰ, ͍ͭͰ΋৽͍͠։ൃ؀ڥΛखʹೖΕΔ͜ͱ͕Ͱ͖·͢
  26. Vagrant is a general purpose tool. Use it in a

    way that works best for you. Vagrant ͸ʮ։ൃϑϩʔʯͱ͍͏ڞ௨ͷ՝୊Λղܾ͢ΔͨΊͷπʔϧͰ͢ ੋඇɼ͋ͳͨʹͱͬͯ࠷ߴͷ։ൃ؀ڥΛखʹೖΕ͍ͯͩ͘͞
  27. Boxes: Template from which machines are created. Contains pre-installed OS.

    Boxes ͱ͸ੜ੒͞ΕΔ؀ڥͷςϯϓϨʔτͰ, ࣄલʹΠϯετʔϧ͞Εͨ OS ͳͲؚ͕·Ε͍ͯ·͢
  28. Vagrantfile: Per-project configuration file describing how to configure the machine.

    Vagrantfile ͱ͸ϓϩδΣΫτຖͷઃఆϑΝΠϧͷ͜ͱͰ, ͲͷΑ͏ʹ؀ڥΛߏ੒͢Δ͔͕ॻ͔Ε͍ͯ·͢
  29. `vagrant`: Command-line tool. Complete lifecycle management of the development environment.

    `vagrant` ͱ͸୺຤Ͱ࣮ߦ͢ΔίϚϯυͷ͜ͱͰ, ։ൃ؀ڥʹରͯ͠ԿΒ͔ͷૢ࡞͢Δͱ͖ʹ࢖͍·͢
  30. Configures host/guest to share files with each other. Synced Folders

    ͱ͸, ϗετ/ήετؒͰϑΥϧμΛڞ༗͢ΔͨΊͷػೳͰ͢
  31. Allows developers to continue using their own editors in an

    OS they’re comfortable with. ͜ͷػೳʹΑΓɼྫ͑͹, ։ൃऀ͸޷͖ͳΤσΟλΛ࢖͏͜ͱ͕Ͱ͖ΔΑ͏ʹͳΓ·͢
  32. Configures network access to services on the guest from the

    host and vice versa. Networking ͱ͸ωοτϫʔΫߏ੒Λௐ੔͢ΔػೳͰ, ϗετ/ήετؒͰࣗ༝ʹωοτϫʔΫΛڞ༗͢Δ͜ͱ͕Ͱ͖·͢
  33. Enables developers to use browsers, remote debuggers, etc. that they’re

    used to. ݁Ռͱͯ͠ɼ։ൃऀ͸, ͍ͭ΋࢖͍ͬͯΔϒϥ΢β/σόοΨΛͦͷ··࢖͏͜ͱ͕Ͱ͖·͢
  34. Use shell scripts, Chef, Puppet, CFEngine, etc. to automatically install

    and configure software. Provisioning ͸ɼγΣϧεΫϦϓτ΍ Chef, Puppet, CFEngine ͳͲΛ࢖ͬͯ, ιϑτ΢ΣΞΛࣗಈతʹΠϯετʔϧͨ͠Γௐ੔ͨ͠Γ͢ΔػೳͰ͢
  35. Bonus: Solves an ops problem while encouraging devs to learn

    what goes on under the hood. ͪͳΈʹɼ͜ͷ Provisioning ػೳ͸, ΤϯδχΞ͕։ൃ؀ڥΛֶश͢ΔΩοΧέʹ΋ͳΔΑ͏Ͱ͢
  36. Model distributed systems using Vagrant. Vagrant manages an entire cluster.

    Multi-machine ͸ɼVagrant Λ࢖ͬͨ෼ࢄγεςϜΛϞσϧԽ͢ΔػೳͰ, ͜ΕʹΑΓɼVagrant Ͱඇৗʹେ͖ͳΫϥελΛ؅ཧ͢Δ͜ͱ͕Ͱ͖·͢
  37. These were 1.0 features. Proven, important. A strong foundation. ͜͜·ͰͰ঺հͨ͠΋ͷ͸ɼVagrant

    1.0 ͔Βఏڙ͞Ε͍ͯͨػೳͰ, े෼ʹख़੒͞ΕͨɼVagrant ͷج൫ͱͳΔॏཁͳػೳͰ͢
  38. 2010: Vagrant 0.1 Vagrant 0.1 It worked, it was okay,

    but it was pretty bare. - VirtualBox: create/destroy - Provision with Chef solo - Only worked on Mac OS X and with Ubuntu VMs. Vagrant 0.1 ͸ɼ͏·͘ಈ͔͢͜ͱ͸Ͱ͖·͕ͨ͠ɼ͍ͭ͘΋ͷ੍ݶ͕͋Γ·ͨ͠. ྫ͑͹VirtulBox͸࡞੒/࡟আͷΈɼ Provision͸Chef soloͷΈɼOS X/Ubuntu ͷΈɼͳͲͰ͢
  39. 2012: Vagrant 1.0 Vagrant 1.0. Solid. Does its job well.

    Dependable. Stable. VirtualBox only, but supports Chef, Puppet, and shell scripts. Guest VMs can be any Linux. Vagrant 1.0 ͔Β͸ɼ͍͔ͭ͘ͷ੍ݶ͸·ͩ͋Δ΋ͷͷɼඇৗʹ҆ఆ͖ͯ͠·ͨ͠. ྫ͑͹ɼϗετ͸ VirtualBox ͷΈରԠͰ͕ͨ͠ɼChef ΍ PuppetɼγΣϧεΫϦϓτͳͲ΋ ࢖͑ΔΑ͏ʹͳΓɼ·ͨɼήετVMʹ͸͋ΒΏΔ Linux ͕࢖͑ΔΑ͏ʹͳΓ·ͨ͠.
  40. 2013: Vagrant 1.1+ Vagrant 1.1+: The Future Works with any

    provider, not just VirtualBox. Works _really_ well on Windows. Will work well with any guest, not just Linux. And... lots more TBA. ͦͯ͠ɼࠓ೥ެ։͞Εͨ Vagrant 1.1 Ҏ߱Ͱ͸ɼVirtualBox Ҏ֎ʹ΋ରԠͰ͖Α͏ʹͳΓ, ·ͨɼWindows ؀ڥͰ΋े෼ʹΑ͘ಈ͔ͤΔΑ͏ʹͳΓ·ͨ͠ɽ ࠓޙ͸ɼήετԾ૝؀ڥʹ Linux Ҏ֎΋࢖͑ΔΑ͏ʹ͢Δ༧ఆʹͳ͍ͬͯ·͢.
  41. Vagrant 1.1+ Welcome to the Future ͜ͷΑ͏ʹൃల͠ଓ͚͍ͯΔ Vagrant Ͱ͕͢, Vagrant

    1.1 Ҏ߱Ͱಋೖ͞ΕΔ(͞Εͨ)ػೳʹ͍ͭͯ΋͝঺հ͠·͢ ʢ༁஫: ݱࡏͷ࠷৽൛͸ Vagrant 1.2.2ʣ
  42. The same Vagrant you know and love, but oh so

    much better. Vagrant 1.1 Ҏ߱ʹͳͬͯ΋ɼࠓ·Ͱͱಉ͡Α͏ʹ࢖͏͜ͱ͕Ͱ͖·͢ ͔͠͠ɼVagrant 1.1 Ҏ߱Ͱ͸ɼࠓ·Ͱʹͳ͍վળ͕Ճ͑ΒΕ͍ͯ͘༧ఆͰ͢
  43. The path to Vagrant 2.0 It won’t be easy, but

    damn it’ll be good. Vagrant 2.0 ·Ͱͷ۩ମతͳܭըʹ͍ͭͯઆ໌͠·͢ ؆୯ͳಓͰ͸͋Γ·ͤΜ͕ɼVagrant ΛΑΓྑ͍πʔϧʹਐԽͤ͞ΔͨΊͷಓͷΓͰ͢
  44. Backwards Compatible* Just “vagrant up” your 1.0.x Vagrantfiles. * Plugins

    from 1.0.x aren’t backwards compatible. ·ͣɼVagrant ͷޙํޓ׵ੑΛอͪ·͢ɽ1.0ܥͷ vagrantfile ΋`vagrant up`Ͱ࣮ߦͰ͖·͢
  45. Vagrant 1.1+: VirtualBox, VMware, AWS, RackSpace, LXC, your toaster. Vagrant

    1.1 ͔Β͸ɼVirtualBox ͚ͩͰͳ͘, VMWare ΍ AWS, RackSpace, LXC ͳͲʹ΋ରԠͰ͖ΔΑ͏ʹͳΓ·ͨ͠
  46. Multiple providers enable Vagrant to do new and awesome things.

    ෳ਺ͷϓϩόΠμʹରԠ͢Δ͜ͱͰɼͲΜͳঢ়گͰ͋ͬͯ΋ ʮ࠷ߴͷ։ൃϑϩʔʯΛఏڙͰ͖ΔΑ͏ʹͳΓ·͢
  47. People love Vagrant for the workflow. Not for VirtualBox. ࢲୡͷϢʔβ͸ɼ࠷ߴͷ։ൃϑϩʔΛಘΔͨΊʹ

    Vagrant Λ࢖͍ͬͯΔͷͰ͋ͬͯ, VirtualBox ΛಘΔͨΊʹ࢖͍ͬͯΔͷͰ͸͋Γ·ͤΜ
  48. Other providers let you have that workflow in an environment

    that works best for you. ࣮ࡍɼଞͷϓϩόΠμʹ΋ରԠͰ͖ͨ͜ͱʹΑΓ, ͲΜͳঢ়گͰ͋ͬͯ΋࠷ߴͷ։ൃϑϩʔ͕ఏڙͰ͖ΔΑ͏ʹͳΓ·ͨ͠
  49. New use cases... Vagrant where Vagrant has never gone before.

    Vagrant ͸ɼ͞ΒͳΔະ஌ͷྖҬʹ଍Λ౿ΈೖΕ͍͖ͯ·͢ গ͚ͩ͠ɼVagrant ͕ఏڙ͢Δະདྷͷ؀ڥΛ঺հ͠·͠ΐ͏
  50. Develop locally. Test remotely. Work in VirtualBox. Test in AWS

    (more prod-like). ϩʔΧϧ؀ڥͰ։ൃ͠ɼϦϞʔτ؀ڥͰςετͰ͖ΔΑ͏ʹͳΓ·͢ ྫ͑͹ʮVirtualBox ্Ͱ։ൃ͠ɼAWS ্Ͱςετ͢Δʯͱ͍ͬͨ։ൃϑϩʔͰ͢
  51. Deploys “vagrant up” an app for staging/production. ·ͨɼσϓϩΠ΋؆ܿʹͳΓɼͨͩ `vagrant up`

    ͱ࣮ߦ͢Δ͚ͩͰ, εςʔδϯά؀ڥ΍ϓϩμΫγϣϯ؀ڥʹσϓϩΠͰ͖ΔΑ͏ʹͳΓ·͢
  52. Vagrant in Vagrant VMware outside. LXC inside. Etcetera. Vagrant ࣗମΛ

    Vagrant Ͱಈ͔͢͜ͱ΋Ͱ͖ΔΑ͏ʹͳΔͰ͠ΐ͏ ྫ͑͹ɼVMware ͷ֎΍ɼLXC ͷதͰ Vagrant Λಈ͔͢ɼͳͲͰ͢
  53. Keep Dreamin’ This is all just the beginning. ͜ΕΒ͸ Vagrant

    ͕ఏڙ͢Δະདྷͷ΄ΜͷҰ෦Ͱ͢ Vagrant ͸͜Ε͔Β΋ເΛ௥͍ଓ͚͍͖ͯ·͢
  54. vagrant up --provider=foo Where foo is “vmware_fusion”, “aws”, etc. Ϣʔβ͸

    `vagrant up --provider foo` Ͱɼ೚ҙͷϓϩόΠμΛࢦఆ͢Δ͜ͱ͕Ͱ͖·͢ foo ʹ͸ɼྫ͑͹ “vmware_fusion” ΍ “aws” ͱ͍ͬͨΦϓγϣϯΛࢦఆͰ͖·͢
  55. Same Vagrantfile, multiple providers. Pretty magical once you see it.

    ݁Ռͱͯ͠ɼಉ͡ Vagrantfile Λෳ਺ͷϓϩόΠμʹద༻ͤ͞Δ͜ͱ͕Ͱ͖·͢ ࣮ࡍʹ࣮ߦͯ͠ΈΔͱɼ·ΔͰຐ๏ͷΑ͏ʹݟ͑Δͱࢥ͍·͢
  56. Vagrant.configure(“2”) do |config| config.vm.box = “precise64” end A Vagrantfile ۩ମྫΛݟ͍͖ͯ·͠ΐ͏ɽ্هͷ

    Vagrantfile ͸, box ʹอଘ͢ΔΠϝʔδϑΝΠϧ໊ (“precise64”)Λࢦఆͨ͠΋ͷͰ͢
  57. $ vagrant box add precise64 \ http://files.vagrantup.com/precise64.box ... $ vagrant

    box add precise64 \ http://files.vagrantup.com/precise64_vmware_fusion.box ... Some Boxes `vagrant box add` Λ࣮ߦ͠ɼઌ΄Ͳઃఆͨ͠ box ʹ VirtualBox/VMware ༻ͷΠϝʔδϑΝΠϧΛμ΢ϯϩʔυ͠·͢
  58. $ vagrant up --provider=virtualbox ... OR $ vagrant up --provider=vmware_fusion

    ... Up in VirtualBox or VMware ࠷ޙʹɼ--provider ͰϓϩόΠμΛࢦఆͯ͠ `vagrant up`͢Δ͚ͩͰ׬ྃͰ͢ ͳ͓ɼσϑΥϧτͰ͸ VirtualBox ͕ىಈ͢ΔΑ͏ʹͳ͍ͬͯ·͢
  59. Best effort. Not every provider can satisfy every Vagrant abstraction,

    but it won’t fail if it can’t. Example: AWS networking doesn’t map well to Vagrant networking. Vagrant + AWS will just ignore networking configurations. Not error. It’ll make a “best effort” to work. ͨͩɼϕετΤϑΥʔτͰఏڙͯ͠ΔͷͰɼϓϩόΠμ͕׬શʹରԠ͠ͳ͍͜ͱ΋͋Γ·͢ ྫ͑͹ AWS Ͱ͸ɼVagrant ʹΑͬͯந৅Խ͞ΕͨωοτϫʔΫߏ੒Λແࢹͯ͠͠·͍·͢
  60. Template for a machine. Base image for VirtualBox, AMI/metadata for

    AWS, etc. Boxes ͸ɼ؀ڥΛߏங͢ΔͨΊͷςϯϓϨʔτͳͷͰ, ྫ͑͹ɼVirtualBox Ͱಈ͘ΠϝʔδϑΝΠϧΛ࡞ΔΑ͏ʹ, AWS Ͱಈ͘ΠϝʔδϑΝΠϧͳͲ΋࡞Ε·͢.
  61. $ vagrant box list centos (virtualbox) precise64 (aws) precise64 (virtualbox)

    precise64 (vmware_fusion) Tied to a Provider ্ه͸ɼ֤ϓϩόΠμʹରͯ͠ box Λ࡞ͬͨ৔߹ͷྫͰ͢
  62. You need a box for each provider. This process is

    manual, for now. ݱঢ়Ͱ͸ɼ֤ϓϩόΠμʹରͯ͠खಈͰ box Λ࡞੒͢Δඞཁ͕͋Γ·͢
  63. VirtualBox: OVF export VMware: VMX export LXC: rootfs tarball AWS:

    Metadata (AMI info) What’s in a box? It varies by provider. Actually, anything can be in a box. The provider is responsible for reading and verifying structure. ֤ϓϩόΠμʹରԠ͢ΔͨΊɼBox ͸৭ʑͳϑΥʔϚοτʹରԠ͍ͯ͠·͢ ྫ͑͹ VirtualBox ͸ OVFɼVMware ͸ VMXɼAWS ʹ͸ AMI ϑΝΠϧͱ͍ͬͨ۩߹Ͱ͢
  64. Provider-Specific Config The full power of the provider, if you

    need it. Abstractions are nice, but sometimes you want to take advantage of specific properties of a provider. For example, AWS can do things VMware can’t, and vice versa. Provider-specific config lets you do that. ෳ਺ͷϓϩόΠμʹରԠ͢ΔͨΊɼϓϩόΠμຖʹઃఆΛՃ͑ΒΕΔΑ͏ʹͳΓ·ͨ͠ ͜ΕʹΑΓɼ֤ϓϩόΠμͰ࠷ߴͷύϑΥʔϚϯε͕ൃشͰ͖ΔΑ͏ʹௐ੔Ͱ͖·͢
  65. Vagrant.configure(“2”) do |config| config.vm.box = “precise64” config.vm.provider “virtualbox” do |v|

    v.customize [“modifyvm”, :id, “--memory”, “2048”] end config.vm.provider “vmware_fusion” do |v| v.vmx[“memsize”] = “2048” end end Example: Setting Memory ྫ͑͹ɼVirtualBox ͱ VMware Ͱ͸̎MB෼ͷϝϞϦΛ࢖͏, ͱ͍ͬͨײ͡ͰઃఆͰ͖·͢
  66. Vagrant.configure(“2”) do |config| config.vm.box = “precise64” config.vm.provider “virtualbox” do |v|

    v.customize [“modifyvm”, :id, “--memory”, “2048”] end config.vm.provider “vmware_fusion” do |v| v.vmx[“memsize”] = “2048” end end Example: Setting Memory ԫ৭͘ϋΠϥΠτ͞Ε͍ͯΔՕॴ͕ɼ VirtualBox ͷઃఆͰ͢
  67. Vagrant.configure(“2”) do |config| config.vm.box = “precise64” config.vm.provider “virtualbox” do |v|

    v.customize [“modifyvm”, :id, “--memory”, “2048”] end config.vm.provider “vmware_fusion” do |v| v.vmx[“memsize”] = “2048” end end Example: Setting Memory ͦͯͪ͜͠Β͕ VMware ͷઃఆʹͳΓ·͢
  68. Portable Even if the user doesn’t have that provider installed,

    the Vagrantfile will still work. ͜ͷΑ͏ͳϓϩόΠμຖͷઃఆʹ͸Ҡ২ੑ͕͋Γ·͢ ҰํͰɼ΋͠Ϣʔβ͕ͦͷϓϩόΠμΛΠϯετʔϧ͍ͯ͠ͳͯ͘΋, Vagrantfile ͕ͪΌΜͱಈ͘Α͏ʹͳ͍ͬͯ·͢
  69. Clear Purpose It makes it clear that that configuration applies

    ONLY to specific providers. ઃఆϑΝΠϧʹॻ͔Εͨ಺༰͸ɼରԠͨ͠ϓϩόΠμʹͷΈద༻͞ΕΔͨΊ, ͲͷϓϩόΠμʹରͯ͠Ͳ͏ઃఆ͍ͯ͠Δͷ͔͕໌֬ʹͳΓ·͢
  70. Power A place to expose full capabilities of underlying providers.

    ϓϩόΠμຖʹ͏·͘ઃఆΛॻ͘͜ͱ͕Ͱ͖Ε͹, ֤ϓϩόΠμΛ࠷େݶ༗ޮ׆༻Ͱ͖ΔͰ͠ΐ͏
  71. Totally Optional Just use a normal Vagrantfile if you don’t

    care. This is for power users. ࠷ޙʹɼࠓճ৽ͨʹ঺հͨ͠ػೳ͸ɼඞਢͷػೳͰ͸͋Γ·ͤΜ. ΋ͪΖΜɼࠓ·Ͱͱಉ͡Α͏ʹ Vagrantfile Λ࢖͏͜ͱ΋Ͱ͖·͢. ͜ͷػೳʹΑΓɼϔϏʔϢʔβͷཁ๬ʹ΋Ԡ͑ΒΕΔΑ͏ʹͳͬͨɼͱ͍͏͜ͱͰ͢.
  72. That’s it. Same powerful workflow, clean abstractions, uncompromised flexibility. Vagrant

    ͸ࠓޙ΋े෼ͳந৅ԽʹྭΈɼॊೈੑʹଥڠͤͣ, ࠷ߴͷ։ൃϑϩʔΛఏڙ͠ଓ͚·͢.
  73. Can dramatically speed up “vagrant up” time if box is

    pre-provisioned. ݁Ռͱͯ͠ɼࣄલʹ box ͕ఔΑ͘४උ͞Ε͍ͯΕ͹, `vagrant up` ͷ࣮ߦ࣌ؒΛܶతʹॖΊΔ͜ͱ͕Ͱ͖·͢
  74. New, released June 2013. Lots of people using already. Packer

    ͸ 2013೥6݄ʹϦϦʔε͞Εɼطʹଟ͘ͷਓୡ͕࢖͍ͬͯ·͢