the answer to all the questions is yes.

you have 2 ways of attack this problem.

- The machies are indepent, so you create separate vagrantfiles
- the machines are relates, so you create a multi-machine vagrantfile

you are in the second, so, start with the same multi-machine vagrantfile

The important bits are pretty much here:

config.vm.define "web" do |web|
    web.vm.box = "hashicorp/precise64"
  end

what ever is local for that machine should go was web.* isnide the define
block

config.* // stuff that impact all the machines but are considered first

config.vm.define "web1" do |web1|
    web.vm.box = "hashicorp/precise64"
    web.* // stuff that impact this local machine
end

 config.vm.define "web2" do |web2|
    web2.vm.box = "hashicorp/precise64"
    web2.* // stuff that impact this local machine
end

config.* // stuff that impact all the machines but are considered last

Vagrant files are read couple of times and whatever is in there is what
gets executed.. top to bottom,,. so the here web1 will be created first,
then web2 will be created as last.

when the list of commands is built, all the instructions (box, provisioner,
provider, etc) is read top to bottom, so, what you will see in a multi
machine vagrant up will be like:

- first machine created
- what you define first (as config.) take is as a global instuction set..
gets run
- then what ever is inside each define block
- what you define last

 - second machine created
- what you define first (as config.) take is as a global instuction set..
gets run
- then what ever is inside each define block
- what you define last

..

..

 - last machine created
- what you define first (as config.) take is as a global instuction set..
gets run
- then what ever is inside each define block
- what you define last

Hope this helps.
Alvaro.



On Fri, Oct 24, 2014 at 8:34 AM, Vince Skahan <[email protected]> wrote:

> Coming from a VMware Workstation background, I'm struggling a bit with the
> vagrant commands and what's where under the hood.
>
> What I'm trying to do is:
>
>    - create multiple VMs based on the same base distro (say
>    ubuntu/trusty64)
>    - name the multiple VMs individually (say 'hostA' and 'hostB')
>    - be able to start/stop them independently
>    - be able to run them simultaneously as needed
>    - definitely be able to have them configured differently when I get
>    done with them
>
> To me, this isn't the same as
> https://docs.vagrantup.com/v2/multi-machine/index.html which is more like
> a VMware Workstation Team kind of scenario (correct me if I'm reading it
> wrong).  I just want to have multiple VMs derived from the same base
> starting point that I can start/stop/alter differently.
>
> I'm running vagrant-1.6.5 on a Macbook with VirtualBox if that matters...
>
> Any help appreciated....thanks...
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to