Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is deployment to Production done from local VirtualBox / Vagrant development environment?

Recently I started to read about building development environments with virtualization software (I am a beginner) and it seems that 'infrastructure as a code' is a really powerful concept.

I really like the workflow structure described here:

  1. The same base VirtualBox image is used around the team
  2. Vagrant is used to quickly 'build up' and 'provision' such an image to a needed configuration with the help of
  3. Chef (or Puppet) recipes which is the only piece of code needed to be put under version control.

However, I still do not quite understand how the code is transferred and deployed on Production servers.

As I understand, the common way of keeping DEV and PROD environments identical is to manage the Production server instance as just another virtual image to be provisioned with Chef. I can have exactly the same OS installed on the Production server as I (and the team) use daily with VirtualBox-Vagrant-Chef.

But the Production server can have hardware which differs from that in the virtual guest OS and this might lead to inconsistencies again.

So, here is the question:

What is the known and common best practice to transfer and deploy code to a Production server from a development environment which is managed with the VirtualBox-Vagrant-Chef toolchain? Does this practice allow any continuous deployment?

[Edit]: Note: Is there any practice of running the same VM instance provisioned with Chef/Vagrant on the Production server, like it is depicted on this diagram?

like image 856
skanatek Avatar asked Jun 12 '14 12:06

skanatek


People also ask

Is vagrant used for production?

Users of Vagrant for years have wanted a way to deploy their Vagrant environments to production. Unfortunately, the Vagrantfile doesn't contain enough information to build a proper production environment with industry best practices. An Appfile is made to encode this knowledge, and deployment is a single command away.

What is vagrant VirtualBox?

Vagrant is an open-source tool that allows you to create, configure, and manage boxes of virtual machines through an easy to use command interface. Essentially, it is a layer of software installed between a virtualization tool (such as VirtualBox, Docker, Hyper-V) and a VM.

What is the purpose of vagrant?

“Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the works on my machine excuse a relic of the past.”


1 Answers

I'm the author of the article you linked, so my 0.02

If I understood correctly your question, you don't move the vms from dev to production, you create a repeatable process that allows you to create the same end state (OS + config + app) over and over again, no matter where the destination is.

By using vagrant you guarantee that your devs use the same OS that your production servers use no matter what OS they use for development.

Using Puppet/Chef you guarantee that the OS is configured the same whether it is running in a vm with Vagrant, a vm in production, a cloud vm, or bare metal hardware. It doesn't need to be virtual.

like image 134
csanchez Avatar answered Oct 06 '22 00:10

csanchez