Linux | Cloud | DevOps | Scripting

Breaking

VAGRANT INTERVIEW QUESTIONS AND ANSWERS

Q. What is Vagrant?
A. Vagrant is a tool to manage virtual machine environments and allows you to configure and use reproducible work environments on top of various virtualization and cloud platforms. It also has integration with Ansible as a provisioner for these virtual machines.


Vagrant is an open-source software product for building and maintaining portable virtual software development environments, like; VirtualBox, Hyper-V, Docker containers, VMware, and AWS. It tries to simplify software configuration management of virtualizations in order to increase development productivity.

Q. Why do we use Vagrant?
A. Vagrant primary purpose is to create custom isolated development environments.

Q. What is Box and how can we create a box?
A. A box is a compressed file that contains all the files we need to start a vagrant virtual machine. We use vagrant init command to create a vagrant box.

Q. In which language Vagrant is written?
A. Ruby Language

Q. What is provider in Vagrant?
A.

Q. What is Provisioner in Vagrant?
A.

Q. What are the subcommands associated with Box command? What they are used?
A. Command: C:\> vagrant box -h

Usage: vagrant box <subcommand> [<args>]
Available subcommands:
  1. Add (vagrant box add <address to vagrant>)
    this command adds a box with the given address to Vagrant
  2. List (vagrant box list)
    this command lists all the boxes that are installed into Vagrant
  3. Outdated (vagrant box outdated)
    this command tells us the current vagrant environment is outdated or not
  4. Prune (vagrant box prune)
    this command removes old versions of installed boxes. If the box is currently in use vagrant will ask for confirmation
  5. Remove (vagrant box remove <box_name>)
    this command removes a box from Vagrant that matches the given name
  6. Repackage (vagrant box repackage <box_name> <provider> <version>)
    this command repackages the given box and puts it in the current directory so you can redistribute it. The name, provider, and version of the box can be retrieved using vagrant box list
  7. Update (vagrant box update)
    this command updates the box for the current Vagrant environment if there are updates available
Q. What is Vagrant Share?
A.

Q. What does Connect, Destroy and Global Status commands do?
A. 

Q. How do you define multiple machines in Vagrant?
A. Multiple machines are defined within the same project Vagrantfile using the config.vm.define method call.

Q. What are Plugins in Vagrant and how they assist?
A. Vagrant has a lot of great features to get our environment up and running. Sometimes if we want to change or add some additional functionality to Vagrant, that thing can be done via Vagrant Plugins.

Q. What is Vagrant push?
A. Vagrant push are defined in Vagrantfile of an application and these pushes are called using vagrant push command. Vagrant is capable of deploying or pushing application code from Vagrantfile to remote like an FTP server.


Q. When Provisioning Happens?
A. Provisioning happens at certain points during the lifetime of your Vagrant environment:

1. On the first vagrant up that creates the environment, provisioning is run. If the environment was already created and the up is just resuming a machine or booting it up, they will not run unless the --provision flag is explicitly provided.

2. When vagrant provision is used on a running environment.

3.When vagrant reload --provision is called. The --provision flag must be present to force provisioning.

You can also bring up your environment and explicitly not run provisioners by specifying --no-provision.





No comments:

Post a Comment

Pages