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

Vagrant: How & Why

Vagrant: How & Why

What is Vagrant? Why do you need it?

Celestine Omin

January 26, 2017
Tweet

More Decks by Celestine Omin

Other Decks in Programming

Transcript

  1. What is Vagrant? Vagrant is a tool that allows you

    create and configure lightweight, reproducible, and portable development environments. Build virtual cloud on your workstation.
  2. What is Vagrant? Vagrant is a tool that allows you

    create and configure lightweight, reproducible, and portable development environments. Build virtual cloud on your workstation. Image source: laracast.com
  3. Pre-vagrant TYPICAL SETUP WHERE VAGRANT ISN’T INVOLVED 1. Install everything

    directly unto the machine. 2. Maintain a long non-updated documentation.
  4. Post-vagrant TYPICAL SETUP AFTER VAGRANT IS INVOLVED 1. Consistency. 2.

    Things just works. 3. Issue of it works on machine doesn’t exist. 4. Life is beautiful.
  5. Core concepts: Vagrantfile config.vm.box = "servlet" config.vm.hostname = "celestine.blog" config.vm.network

    "forwarded_port", guest: 80, host: 8081 config.vm.provision :shell, :path => "vagrant/setup.sh" Box - Name of the box Hostname - Machine’s hostname Network - Network port Provision - Creating and bootstraping machine.
  6. The concept of Vagrant Vagrant relies on the concept of

    virtualisation which entails creating a virtual version of a machine with its own OS inside a simulated hardware environment i.e. a whole new OS is started on your machine with its own kernel, ports, filesystem e.t.c. Virtualisation is enabled using an hypervisor which also uses part of the host’s resources.
  7. The concept of Docker Docker essentially uses the concept of

    containerisation which entails encapsulating/packaging an application in a container with its own operating environment. Containerisation allows multiple applications to run in isolated partitions of a single Linux kernel running directly on the physical hardware. Containers reuse kernel, ports and other low level resources of your machine instead dispatching their own.
  8. • Higher performance than virtualisation since there is no hypervisor

    overhead. • Containers work like just any other process on the host machine, thereby using little host resources when compared to VM’s. • Cached build processes. Faster instantiation time. • Kernel between all instances are shared which makes it lightweight. • Requires a static amount of resources (CPU, RAM e.t.c.) to the VM’s, and the hypervisor uses a lot of resources. • Better integration with Config Mgt tools like Chef, Ansible and Puppet. • Application resources are well isolated thereby achieving near-complete separation. • Runs a wide variety of boxes from Ubuntu, CentOS, WIndows, Solaris e.t.c