Search code examples
vagrantvirtualboxpuppetvagrant-provision

Is Vagrant Provision suppose to wipe out all your data


I just ran vagrant provision in a futile attempt at getting my customized synced_folders directive to work and now my whole guest box is wiped out.

Is this normal? I don't see any references to Vagrant docs about this behavior.

As per the doc:

Provisioners in Vagrant allow you to automatically install software, alter configurations, and more on the machine as part of the vagrant up process.

The only thing I have in my config provision shell commands are installation commands. Nothing about wiping anything out.

I do have app.vm.provision for puppet that sets fqdn, user name and box name (along with the normal module_path, manifests_path and manifests_file). Maybe this caused things to be reset?


Solution

  • So what appears to have happened was that when I set up a synced folder, it wiped out everything because there was nothing on my host machine in that synced folder. Unless there is a way to recover the lost data, there should be an unmistakable WARNING in their docs that this can happen.

    I setup the synced_folder to be on my whole home directory. When I created a new machine, I cloned the one project I had saved and decided to just sync my individual projects instead of my whole user directory this time. When I reloaded, the project directory was empty since it was empty on my host machine.

    So I guess, make sure the directories on your host machine are already setup with the data before configuring your Vagrantfile with synced_folder information.