4 ##############################################################################
5 # Copyright (c) 2017 Alexis de Talhouƫt. All rights reserved.
7 # This program and the accompanying materials are made available under the
8 # terms of the Eclipse Public License v1.0 which accompanies this distribution,
9 # and is available at http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
12 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
13 VAGRANTFILE_API_VERSION = "2"
15 $install_odl = <<SCRIPT
18 cp -r /vagrant/opendaylight/* opendaylight/
19 nohup /vagrant/scripts/setup_odl.sh > setup_odl.log 2>&1 &
22 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
24 num_nodes = (ENV['NUM_OF_NODES'] || 1).to_i
26 config.vm.box = "trusty-server-cloudimg-amd64"
27 config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
29 num_nodes.times do |n|
30 config.vm.define "odl-#{n+1}" do | node |
31 node.vm.host_name = "odl-#{n+1}"
32 node.vm.network "private_network", :adapter=>2, ip: "192.168.50.15#{n+1}", bridge: "en0: Wi-Fi (AirPort)"
33 node.vm.provider :virtualbox do |v|
34 v.customize ["modifyvm", :id, "--memory", 4096]
35 v.customize ["modifyvm", :id, "--cpus", 4]
37 node.vm.provision "install_odl", type: "shell", inline: $install_odl