Parallel launch of a multi-user machine

I am trying to provide a pair of master-master MySQL and they can only be configured correctly if both of them.

Vagrant.configure("2") do |config|
  web.vm.box = "centos/7"

  config.vm.define "primary" do |primary|
    .......
  end

  config.vm.define "secondary" do |secondary|
    .......
  end
end

I have done this several times, and Vagrant starts the second vm after the first one got up.

Is there a way to get Vagrant to run two virtual machines at the same time?

+4
source share
1 answer

vagrant upsupports parallel start of the VM using the key --parallel:

- [no-] parallel Enable or disable parallelism, if the provider supports it

vagrant VirtualBox , xargs, -P <max-procs> ( Vagrantfile):

grep config.vm.define Vagrantfile | awk -F'"' '{print $2}' | xargs -P2 -I {} vagrant up {}
+1

Source: https://habr.com/ru/post/1684248/


All Articles