Force Multi-machine To Deploy Sequentially

I’m using a multi-machine Vagrantfile, with a combination of servers, clients, and routing vms. I wrote my vagrant file to deploy these in groups using for_each, and ordered these clauses in the order they should be powered up - first routers, then servers, then clients.

When I run vagrant up, the output from all the vms is coming back in parallel, leading me to believe that they are being deployed in parallel. Because my provisioning depends on the order of setup, I can’t reliably deploy.

Is there a way to enforce a strict ordering in a single vagrant file?

This is an issue with the documentation. The default behavior is not clearly communicated. To save others the time I lost debugging this:

Some providers parallelize deployment of multiple machines, and it appears that the default behavior is to parallelize if possible.

Passing --no-parallel to vagrant up enforces that they are run sequentially in multi-machine Vagrantfiles.

There is an “enhancement” issue open to change the default to non-parallel, but it has not been acknowledged or otherwise acted on as of this writing.

If I may suggest: to speedup vagrant up you could leave parallelisation enabled, and modify your provisioners to wait until the needed VMs are running before proceeding.