diff options
-rw-r--r-- | resources/tools/vagrant/Vagrantfile | 53 | ||||
-rw-r--r-- | topologies/available/vagrant.yaml | 48 |
2 files changed, 75 insertions, 26 deletions
diff --git a/resources/tools/vagrant/Vagrantfile b/resources/tools/vagrant/Vagrantfile index 46e214693d..86e78602aa 100644 --- a/resources/tools/vagrant/Vagrantfile +++ b/resources/tools/vagrant/Vagrantfile @@ -41,7 +41,8 @@ $install_vpp = <<-SHELL SHELL -def add_dut(config, name, mgmt_ip, net1, net2) +def add_dut(config, name, mgmt_ip, port1, port2, port3, port4) + config.vm.box_check_update = false config.vm.define name do |node| node.vm.box = "fdio-csit/ubuntu-14.04.4_2016-05-25_1.0" node.vm.hostname = name @@ -50,17 +51,18 @@ def add_dut(config, name, mgmt_ip, net1, net2) node.vm.provision "shell", inline: $install_vpp node.vm.network "private_network", ip: mgmt_ip - node.vm.network "private_network", type: "dhcp", auto_config: false, - virtualbox__intnet: net1 - node.vm.network "private_network", type: "dhcp", auto_config: false, - virtualbox__intnet: net2 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port1 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port2 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port3 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port4 node.vm.provider "virtualbox" do |vb| vb.memory = "3232" vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] vb.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"] + vb.customize ["modifyvm", :id, "--nicpromisc5", "allow-all"] + vb.customize ["modifyvm", :id, "--nicpromisc6", "allow-all"] end end - end net_prefix = '' @@ -68,9 +70,9 @@ if ENV.key?('VPP_VAGRANT_NET_PREFIX') net_prefix = ENV['VPP_VAGRANT_NET_PREFIX'] + '_' end -Vagrant.configure(2) do |config| +def add_tg(config, name, mgmt_ip, port1, port2, port3, port4, port5, port6) config.vm.box_check_update = false - config.vm.define "tg" do |tg| + config.vm.define name do |node| if Vagrant.has_plugin?("vagrant-proxyconf") if ENV["http_proxy"] config.proxy.http = ENV["http_proxy"] @@ -82,25 +84,32 @@ Vagrant.configure(2) do |config| config.proxy.no_proxy = ENV["no_proxy"] end end - tg.vm.box = "fdio-csit/ubuntu-14.04.4_2016-05-25_1.0" - tg.vm.hostname = "tg" + node.vm.box = "fdio-csit/ubuntu-14.04.4_2016-05-25_1.0" + node.vm.hostname = name + node.vm.provision "shell", inline: $user_addition + node.vm.provision "shell", inline: $install_prereqs - tg.vm.provision "shell", inline: $user_addition - tg.vm.provision "shell", inline: $install_prereqs - tg.vm.network "private_network", ip: '192.168.255.100/24' - tg.vm.network "private_network", type: "dhcp", auto_config: false, - virtualbox__intnet: net_prefix + "tg_dut1" - tg.vm.network "private_network", type: "dhcp", auto_config: false, - virtualbox__intnet: net_prefix + "tg_dut2" - tg.vm.provider "virtualbox" do |vb| + node.vm.network "private_network", ip: mgmt_ip + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port1 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port2 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port3 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port4 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port5 + node.vm.network "private_network", type: "dhcp", auto_config: false, virtualbox__intnet: port6 + node.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] vb.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"] + vb.customize ["modifyvm", :id, "--nicpromisc5", "allow-all"] + vb.customize ["modifyvm", :id, "--nicpromisc6", "allow-all"] + vb.customize ["modifyvm", :id, "--nicpromisc7", "allow-all"] + vb.customize ["modifyvm", :id, "--nicpromisc8", "allow-all"] end - end - - add_dut(config, "dut1", "192.168.255.101/24", net_prefix + "tg_dut1", net_prefix + "dut1_dut2") - add_dut(config, "dut2", "192.168.255.102/24", net_prefix + "tg_dut2", net_prefix + "dut1_dut2") end +Vagrant.configure(2) do |config| + add_tg(config, "tg", "192.168.255.100/24", net_prefix + "tg_tg", net_prefix + "tg_tg", net_prefix + "tg_dut1_1", net_prefix + "tg_dut1_2", net_prefix + "tg_dut2_1", net_prefix + "tg_dut2_2") + add_dut(config, "dut1", "192.168.255.101/24", net_prefix + "tg_dut1_1", net_prefix + "tg_dut1_2", net_prefix + "dut1_dut2_1", net_prefix + "dut1_dut2_2") + add_dut(config, "dut2", "192.168.255.102/24", net_prefix + "tg_dut2_1", net_prefix + "tg_dut2_2", net_prefix + "dut1_dut2_1", net_prefix + "dut1_dut2_2") +end diff --git a/topologies/available/vagrant.yaml b/topologies/available/vagrant.yaml index 6c724c495f..a5a5ed511e 100644 --- a/topologies/available/vagrant.yaml +++ b/topologies/available/vagrant.yaml @@ -14,16 +14,36 @@ nodes: username: csit password: csit interfaces: - port3: + port1: mac_address: "" pci_address: "0000:00:09.0" + link: link0 + driver: e1000 + port2: + mac_address: "" + pci_address: "0000:00:0a.0" + link: link0 + driver: e1000 + port3: + mac_address: "" + pci_address: "0000:00:10.0" link: link1 driver: e1000 + port4: + mac_address: "" + pci_address: "0000:00:11.0" + link: link4 + driver: e1000 port5: mac_address: "" - pci_address: "0000:00:0a.0" + pci_address: "0000:00:12.0" link: link2 driver: e1000 + port6: + mac_address: "" + pci_address: "0000:00:13.0" + link: link5 + driver: e1000 DUT1: type: DUT host: "192.168.255.101" @@ -36,11 +56,21 @@ nodes: pci_address: "0000:00:09.0" link: link1 driver: e1000 - port3: + port2: mac_address: "" pci_address: "0000:00:0a.0" + link: link4 + driver: e1000 + port3: + mac_address: "" + pci_address: "0000:00:10.0" link: link3 driver: e1000 + port4: + mac_address: "" + pci_address: "0000:00:11.0" + link: link6 + driver: e1000 DUT2: type: DUT host: "192.168.255.102" @@ -53,8 +83,18 @@ nodes: pci_address: "0000:00:09.0" link: link2 driver: e1000 - port3: + port2: mac_address: "" pci_address: "0000:00:0a.0" + link: link5 + driver: e1000 + port3: + mac_address: "" + pci_address: "0000:00:10.0" link: link3 driver: e1000 + port4: + mac_address: "" + pci_address: "0000:00:11.0" + link: link6 + driver: e1000 |