blob: 8670d65867c5fd0fc03b1563c9973e63f46af501 [file] [log] [blame]
alshabib4997cd72016-05-24 22:48:29 -07001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4Vagrant.configure(2) do |config|
5
6 if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
7 config.vm.synced_folder ".", "/vagrant", mount_options: ["dmode=700,fmode=600"]
8 else
9 config.vm.synced_folder ".", "/vagrant"
10 end
11
Luca Prete8d4e8bc2016-08-24 14:49:54 -070012 config.vm.provider "virtualbox" do |v|
13 v.customize ["modifyvm", :id, "--vram", "32"]
14 end
15
Luca Preted8d82312017-03-23 10:26:16 -070016 # Creates an ONOS tutorial VM.
17 # It contains Mininet, three LXC containers used as ONOS target machines, the tutorial files.
18 # The machine comes also with the Ubuntu GUI to support tutorials.
Luca Prete8d4e8bc2016-08-24 14:49:54 -070019 config.vm.define "onostutorial" do |d|
20 d.vm.box = "ubuntu/xenial64"
21 d.vm.hostname = "onostutorial"
22 d.vm.network "private_network", ip: "10.100.198.200"
23 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
24 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local"
25 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-dev-clean.yml -c local"
26 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local"
27 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-install.yml -c local"
28 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/gui.yml -c local"
29 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/ide-install.yml -c local"
30 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-tutorials.yml -c local"
31 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/machine-restart.yml -c local"
32 d.vm.provider "virtualbox" do |v|
33 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
34 v.memory = 4096
35 v.cpus = 2
36 end
37 end
38
Luca Preted8d82312017-03-23 10:26:16 -070039 # Creates a VM with three LXC containers inside.
40 # Miniet is installed on the virtual machine itself.
41 # The three LXC containers serve as ONOS target machines.
42 config.vm.define "onosdevmn" do |d|
Luca Prete8d4e8bc2016-08-24 14:49:54 -070043 d.vm.box = "ubuntu/xenial64"
Luca Preted8d82312017-03-23 10:26:16 -070044 d.vm.hostname = "onosmn"
alshabib4997cd72016-05-24 22:48:29 -070045 d.vm.network "private_network", ip: "10.100.198.200"
46 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
Luca Prete8d4e8bc2016-08-24 14:49:54 -070047 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local"
48 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local"
49 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-dev-clean.yml -c local"
alshabib4997cd72016-05-24 22:48:29 -070050 d.vm.provider "virtualbox" do |v|
51 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
Luca Prete8d4e8bc2016-08-24 14:49:54 -070052 v.memory = 4096
alshabib4997cd72016-05-24 22:48:29 -070053 v.cpus = 2
54 end
55 end
Eric Tang49c291d2018-04-29 14:16:08 +080056
57 # Creates an ONOS VM.
58 # It contains Mininet and three LXC containers used as ONOS target machines.
59 config.vm.define "onosvm" do |d|
60 d.vm.box = "ubuntu/xenial64"
61 d.vm.hostname = "onosvm"
62 d.vm.network "private_network", ip: "10.100.198.200"
63 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
64 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local"
65 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-dev-clean.yml -c local"
66 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local"
67 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-install.yml -c local"
68 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/machine-restart.yml -c local"
69 d.vm.provider "virtualbox" do |v|
70 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
71 v.memory = 4096
72 v.cpus = 2
73 end
74 end
alshabibbdb7b372016-05-25 09:46:49 -070075
Luca Preted8d82312017-03-23 10:26:16 -070076 # Creates a VM with three LXC containers inside, to be used as ONOS target machines.
77 config.vm.define "onosdev" do |d|
78 d.vm.box = "ubuntu/xenial64"
79 d.vm.hostname = "onosdev"
80 d.vm.network "private_network", ip: "10.100.198.200"
81 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
82 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local"
83 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local"
84 d.vm.provider "virtualbox" do |v|
85 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
86 v.memory = 4096
87 v.cpus = 2
88 end
89 end
90
91 # Creates a VM and installs Mininet in it.
alshabibbdb7b372016-05-25 09:46:49 -070092 config.vm.define "mn" do |d|
Luca Prete8d4e8bc2016-08-24 14:49:54 -070093 d.vm.box = "ubuntu/xenial64"
alshabibbdb7b372016-05-25 09:46:49 -070094 d.vm.hostname = "mn"
95 d.vm.network "private_network", ip: "10.100.198.100"
96 d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
Luca Prete8d4e8bc2016-08-24 14:49:54 -070097 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local"
alshabibbdb7b372016-05-25 09:46:49 -070098 d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local"
99 d.vm.provider "virtualbox" do |v|
100 v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
101 v.memory = 2048
102 end
103 end
104
alshabib4997cd72016-05-24 22:48:29 -0700105end