I'm attempting to setup a host-only network that is shared between multiple VMs as part of the configuration of the environment.
As such the end goal is that each VM has its required NAT network on adapter 1 and then has an adapter that is on a host-only shared network that they can all talk over. On this then I can set IPs as needed to do other simple configurations successfully in a set network design.
Every time I end up destroying and re-creating the environments I have another new host-only adapter created. Right now in my testing I'm up around 15 Host-only adapters in my system which is a tad much.
Is there any way to say "use the first/second or third" private_network (Host-Only Adapter) so vagrant doesn't keep creating new adapters?
Example Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Every Vagrant development environment requires a box. You can search for # boxes at https://atlas.hashicorp.com/search.
BOX_IMAGE = "centos/7"
NODE_COUNT = 1
Vagrant.configure("2") do |config|
config.vm.define "master" do |subconfig|
subconfig.vm.box = BOX_IMAGE
subconfig.vm.hostname = "master"
subconfig.vm.network :private_network, ip: "10.0.0.10"
#subconfig.vm.network :public_network
end
(1..NODE_COUNT).each do |i|
config.vm.define "node#{i}" do |subconfig|
subconfig.vm.box = BOX_IMAGE
subconfig.vm.hostname = "node#{i}"
subconfig.vm.network :private_network, ip: "10.0.0.#{i + 10}"
end
end
end