Hello.

Please have this following Vagranfile as example.

run `vagrant status` and you will see will show 5 VMs

you can adjust the number and name, and use it as base.

Hope this helps

# Vagrantfile API/syntax version. Don't touch unless you know what you're
doing!

Vagrant.configure("2") do |config|

  config.vm.box = "hashicorp/precise64"

  #agent box

  (1..5).each do |i|

    vm_name = "agent#{i}"

    config.vm.define vm_name do |agent|

      agent.vm.hostname = vm_name

    end

  end

end


Alvaro

On Wed, Jan 6, 2016 at 2:49 AM, Steven Iveson <[email protected]> wrote:

> Hi all,
>
> I'm trying to launch a multi-machine environment but find that the first
> guest launched (specified as *server *in the Vagrantfile) actually gets
> the name *rancher-host-02*, thus causing the launch of that second (and
> the third) guest to fail as another guest has the same name.
>
> I've tried being as explicit as possible in the Vagrantfile (rather than
> use a variable) without success. I've also tried to separate the machine
> specifications by using two Vagrant.configure sections, again without
> success.
>
> I assume there's something about how the file is parsed that I'm not aware
> of, or perhaps the loop for the host-01/host-02 guests is wrong in some way?
>
> If I specify 'vagrant up server' the guest is named as expected.
>
> I've also tried deleting cache/d files here:
>
> - C:\Users\...\$where_my_vagrantfile_lives\.vagrant\machines
> - C:\Users\$User_name\.vagrant.d\data\...
>
> Windows: 7
> Vagrant: I've tried 1.7.4 and 1.8.1
> VirtualBox: 5.0.12
>
> My Vagrantfile, plus the rancher plugin are both attached. I have searched
> this group for similar issues and not found any (although its been
> educational regardless).
>
> If anyone can help I'd be very grateful. TIA
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/5bf96783-1343-48f3-a293-5e330b8537af%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/5bf96783-1343-48f3-a293-5e330b8537af%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewQCVCKwhQ%2B-OFbaoNpuwmjvHFXZiqxsEm0fj9C%2BAjWMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to