also posted on stack overflow
<http://stackoverflow.com/questions/34049706/vagrant-up-on-vagrantfile-with-multiple-hosts-launches-all-vms-on-one-host>
:
I have a Vagrant file that I want to use to launch 3 VMs on three separate
hosts. If I run
vagrant up master
vagrant up slave1
vagrant up slave2
things work as expected; I get my three VMs running on three different
hosts.
However, if I just run
vagrant up
I end up with all the machines on one host. There are similar issues with
vagrant destroy.
Am I doing something wrong? Is there a flag I need to set?
My setup:
- I'm running vagrant from a Ubuntu 14.04LTS desktop.
- provider = libvirt
- I used vagrant-mutate to make the box libvirt compatible
- vagrant version 1.7.4
- VAGRANT_DEFAULT_PROVIDER=libvirt is set in my .bashrc
Hosts:
- Ubuntu Server 14.04LTS
I can expand on this if necessary, but it seems like the problem is
something I'm doing in vagrant; somehow it's only using the .provider
section once???
Vagrantfile:
# -x- mode: ruby -x-
# vi: set ft=ruby :
boxes = [
{
:name => "master",
:host => "192.168.1.21",
:hostname => "hibanako-1",
:mac => "..."
},
{
:name => "slave1",
:host => "192.168.1.22",
:hostname => "hibanako-2",
:mac => "..."
},
{
:name => "slave2",
:host => "192.168.1.23",
:hostname => "hibanako-3",
:mac => "..."
}
]
VAGRANT_API_VERSION = "2"
Vagrant.configure(VAGRANT_API_VERSION) do |config|
boxes.each do |opts|
config.vm.define opts[:name] do |boxconfig|
boxconfig.vm.box = "ubuntu/trusty64"
boxconfig.vm.hostname = opts[:hostname]
boxconfig.vm.network :public_network,
:dev => "p2p1",
:mac => opts[:mac],
:mode => 'bridge'
boxconfig.vm.provider :libvirt do |lv|
lv.host = opts[:host]
lv.username = "..."
lv.connect_via_ssh = true
lv.memory = 1600
lv.cpus = 4
end
end
end
end
Some of the resources I've looked at:
-
https://ttboj.wordpress.com/2014/05/13/vagrant-on-fedora-with-libvirt-reprise/
-
http://stackoverflow.com/questions/23995757/how-to-vagrant-up-multiple-nodes-at-a-time
-
http://stackoverflow.com/questions/33539988/vagrantfile-with-multiple-vm-and-providers
-
http://stackoverflow.com/questions/20787479/vagrant-vms-on-multiple-physical-machines
-
https://liquidat.wordpress.com/2014/03/03/howto-vagrant-libvirt-multi-multi-machine-ansible-and-puppet/
-
http://www.lucainvernizzi.net/blog/2014/12/03/vagrant-and-libvirt-kvm-qemu-setting-up-boxes-the-easy-way/
- (I'm sure there are others ...)
--
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/da14e89e-bde0-47f1-8b37-6684a58c48a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.