Vagrant is a Virtual Machine (VM) Provisioner Tools.
In simple words, it allow you to quickly deploy (run, shutdown, reboot, build, delete) virtual machine but plus you can use it's provisionning feature to install require dependencies or packages on your virtual machines.
The provisionning feature can use different modules (Ansible)
In practice, to work with vagrant, you will write an descriptive file, that contain your server configurations. And you can build that file dozen time instead of configuring VM manually each time.
Before you create a snapshot, you might need some steps.
. Make sure you are in the right folder
cd /your/vagrant/project/pathTo be sure, type the following command
vagrant statusIf you are in the right vagrant project, you will get a list of created VMs with they status like this:
Current machine states:
logs running (virtualbox)
web not created (virtualbox)
This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.
.Create the snapshort
vagrant snapshot save machines_before_configs
. List snapshot
vagrant snapshot list. Restore machine to the snapshot state
vagrant snapshot restore machines_before_configs. Delete a snapshort.
vagrant snapshot delete machines_before_configs. Destroy and rebuild the whole infra
vagrant destroy -f; vagrant up