3

I don't know how Vagrant synced folders are implemented, and the documentation doesn't really say, so I'm not sure if this is something that's workable.

I have a web app that I run under Vagrant, and it logs to myapp.log -- on the guest, it's running from /vagrant/, so this is /vagrant/myapp.log, and then I see this in my (git) working directory as ./myapp.log on the host. This is all using the Vagrant synced folder default settings.

Now I'm splitting my Vagrant config into a multi-machine config, to be more like my production environment. It uses the default synced folder settings, and from inside both of the Vagrant instances, I can see my source code at /vagrant just like before.

Unfortunately, though, in the second VM (which is running the web app), I can see the log file grow, but in the first VM (which is running the external services), it's a static copy of the log file (whatever it was when I started the VM). Worse, on the host, the log file is also the same as it was when I started the VM. That is, new messages are apparently only added to the file in the VM that's actually running the web server. Everybody else thinks that the file is not changing.

Is it possible to use Vagrant synced folders with multi-machine? The documentation doesn't say it's not permitted.

If I can only sync a file with one VM, is there a way to tell Vagrant that I want the "app" VM to sync with the host, and the "services" VM only needs a static view?

0

You must log in to answer this question.

Browse other questions tagged .