3 Vagrant.configure("2") do |config|
5 config.vm.box = "bento/ubuntu-16.04"
7 config.vm.provider :virtualbox do |vb|
8 vb.customize ['modifyvm', :id, '--natnet1', '192.168.240.0/24']
9 vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
10 vb.customize "post-boot",["controlvm", :id, "setlinkstate1", "on"]
13 config.vm.provision "shell", path: "bootstrap.sh", privileged: false
14 config.vm.synced_folder "..", "/demo"
16 config.vm.define "control" do |config|
17 config.vm.hostname = "control"
18 config.vm.network "private_network", ip: "192.168.0.10"
19 config.vm.network "private_network", ip: "192.168.1.10"
20 config.vm.provision "shell", path: "setup_control.sh", privileged: false
21 config.vm.provider :virtualbox do |vb|
22 vb.customize ["modifyvm", :id, "--memory", 8192]
23 vb.customize ["modifyvm", :id, "--cpus", 8]
27 (1 .. $num_compute_nodes).each do |n|
28 config.vm.define vm_name = "compute-#{n}" do |config|
29 config.vm.hostname = vm_name
30 config.vm.network "private_network", ip: "192.168.0.#{n+20}"
31 config.vm.network "private_network", ip: "192.168.1.#{n+20}"
32 config.vm.provision "shell", path: "setup_compute.sh", privileged: false
33 config.vm.provider :virtualbox do |v|
34 v.customize ["modifyvm", :id, "--memory", 40960 ]
35 v.customize ["modifyvm", :id, "--cpus", 8]
36 file_to_disk1 = "large_disk_file.#{n}.vdi1"
37 v.customize ['createhd', '--filename', file_to_disk1, '--size', 1000 * 1024]
38 v.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk1 ]
39 file_to_disk2 = "large_disk_file.#{n}.vdi2"
40 v.customize ['createhd', '--filename', file_to_disk2, '--size', 1000 * 1024]
41 v.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', file_to_disk2 ]
46 config.vm.define "onap" do |config|
47 config.vm.hostname = "onap"
48 config.vm.network "private_network", ip: "192.168.0.2"
49 config.vm.network "private_network", ip: "192.168.1.2"
50 config.vm.provision "shell", path: "create_onap.sh", privileged: false
51 config.vm.provider :virtualbox do |vb|
52 vb.customize ["modifyvm", :id, "--memory", 4096]
53 vb.customize ["modifyvm", :id, "--cpus", 4]