Reputation: 807
I'm trying to fully grasp the Vagrant concept before migrating a first server over to a Vagrant VM.
AFAIK, base images will never be modified by Vagrant so that they can safely be re-used across projects.
But how do you make sure you keep the running VMs consistent as the result of package updaters will differ depending on when you provision it?
For the sake of the argument, I'll use a Debian based box.
My provisioning will start with a sudo apt-get update && sudo apt-get upgrade
to make sure I get the latest version of the software I need to install.
So at date X, I provision the SERVER which gets package updated and get the necessary packages installed.
At date Y, a new VM is provisioned for test purpose. The package update will evidently yield to a different VM.
How do I keep the 2 VMs consistent?
Upvotes: 1
Views: 107
Reputation: 13920
You need to constantly run puppet or chef to make sure the state of the running VMs are the same.
In your case, if you are using Debian stable, you are unlikely to have different packages (deps) as long as the provisioning keeps doing the same things. (Arch Linux changes package names and deps from time to time, that's why very few people use it in production lol).
For base boxes, I recommend using Packer over Veewee (unless you are planning to build Windows base boxes). Check Opscode bento project for packer templates.
Upvotes: 1
Reputation: 512
You should make a base box, for a example with VeeWee
And you should never start out with running apt-get update or yum update etc.. Because as you said for yourself, you never will have a consistent environment.
Do this only while building your own base box. If you want to update the base packages, just make a new base box and load that one with Vagrant
Upvotes: 2