Vagrant Concepts

From NovaOrdis Knowledge Base
Revision as of 20:00, 17 November 2019 by Ovidiu (talk | contribs) (→‎Environment)
Jump to navigation Jump to search

Internal

Environment

A Vagrant environment is a directory with a Vagrantfile in it. An environment is identified by an ID. It has a name, a provider, and its associated directory, and at any moment is in a specific state (for example, "running"). The details of all environments for the logged in user is given by the vagrant global-status command.

The environment ID can be used to control the machine from anywhere on the system, by any command that takes a target machine.

Environment Operations

Environment Operations

State

Global State

Vagrant maintains state corresponding to all its resources managed for a specific user in ~/.vagrant.d:

  • relationship between an environment and global state.

Plugin

https://www.vagrantup.com/docs/plugins/

A plugin extends Vagrant by adding new functionality such as new providers. Plugins extend Vagrant using a stable API. Most of the core Vagrant functionality is implemented using core plugins. Plugins are usually packages as RubyGems.

Plugin State

A plugin is installed by default globally for a user, meaning that its stored in user's global state. As such, plugin identifying information is registered in ~/.vagrant.d/plugins.json and the code itself is stored in ~/.vagrant.d/gems.

Plugin Operations

Plugin Operations

Project

Local Project

Vagrantfile

Vagrantfile

Box

https://www.vagrantup.com/docs/cli/box.html

Vagrant boxes are prepackaged development environments that are the foundation of Vagrant. In most cases, this is usually just a stripped and naked operating system such as Ubuntu, Debian, or CentOS. Boxes exist with the intention to be provisioned with additional features like Apache and PHP using tools like Chef or Puppet. There are publicly available Vagrant boxes: https://www.vagrantup.com/docs/cli/box.html

Dummy Box

Box Operations

Box Operations


Provider

https://www.vagrantup.com/docs/providers/

A provider is the functionality that allows Vagrant to support a specific type of VM. Vagrant ships out of the box with support for VirtualBox, HyperV and Docker. Support for other types of machines can be added via external providers, integrated with Vagrant via plugins. Examples of such providers are AWS provider.

AWS Provider

AWS Provider