alshabib | 4997cd7 | 2016-05-24 22:48:29 -0700 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | Vagrant.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 Prete | 8d4e8bc | 2016-08-24 14:49:54 -0700 | [diff] [blame] | 12 | config.vm.provider "virtualbox" do |v| |
| 13 | v.customize ["modifyvm", :id, "--vram", "32"] |
| 14 | end |
| 15 | |
Luca Prete | d8d8231 | 2017-03-23 10:26:16 -0700 | [diff] [blame] | 16 | # 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 Prete | 8d4e8bc | 2016-08-24 14:49:54 -0700 | [diff] [blame] | 19 | 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 Prete | d8d8231 | 2017-03-23 10:26:16 -0700 | [diff] [blame] | 39 | # 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 Prete | 8d4e8bc | 2016-08-24 14:49:54 -0700 | [diff] [blame] | 43 | d.vm.box = "ubuntu/xenial64" |
Luca Prete | d8d8231 | 2017-03-23 10:26:16 -0700 | [diff] [blame] | 44 | d.vm.hostname = "onosmn" |
alshabib | 4997cd7 | 2016-05-24 22:48:29 -0700 | [diff] [blame] | 45 | d.vm.network "private_network", ip: "10.100.198.200" |
| 46 | d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
Luca Prete | 8d4e8bc | 2016-08-24 14:49:54 -0700 | [diff] [blame] | 47 | 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" |
alshabib | 4997cd7 | 2016-05-24 22:48:29 -0700 | [diff] [blame] | 50 | d.vm.provider "virtualbox" do |v| |
| 51 | v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] |
Luca Prete | 8d4e8bc | 2016-08-24 14:49:54 -0700 | [diff] [blame] | 52 | v.memory = 4096 |
alshabib | 4997cd7 | 2016-05-24 22:48:29 -0700 | [diff] [blame] | 53 | v.cpus = 2 |
| 54 | end |
| 55 | end |
Eric Tang | bec1485 | 2018-05-10 22:55:58 +0800 | [diff] [blame] | 56 | |
| 57 | # Creates an ONOS tutorial VM. |
| 58 | # It contains Mininet, three LXC containers used as ONOS target machines and tutorials: basic, sdnip, optical and distributed. |
| 59 | # The machine comes also with the Ubuntu GUI to support tutorials. |
| 60 | config.vm.define "tutorialvm" do |d| |
| 61 | d.vm.box = "ubuntu/xenial64" |
| 62 | d.disksize.size = "20GB" |
| 63 | d.vm.hostname = "tutorialvm" |
| 64 | d.vm.network "private_network", ip: "10.100.198.200" |
| 65 | d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
| 66 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local" |
| 67 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-dev-clean.yml -c local" |
| 68 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local" |
| 69 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-install.yml -c local" |
| 70 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/ide-install.yml -c local" |
| 71 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-tutorials.yml -c local" |
| 72 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/gui.yml -c local" |
| 73 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/machine-restart.yml -c local" |
| 74 | d.vm.provider "virtualbox" do |v| |
| 75 | v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] |
| 76 | v.memory = 4096 |
| 77 | v.cpus = 2 |
| 78 | v.gui = true |
| 79 | end |
| 80 | end |
Eric Tang | 49c291d | 2018-04-29 14:16:08 +0800 | [diff] [blame] | 81 | |
| 82 | # Creates an ONOS VM. |
| 83 | # It contains Mininet and three LXC containers used as ONOS target machines. |
| 84 | config.vm.define "onosvm" do |d| |
| 85 | d.vm.box = "ubuntu/xenial64" |
| 86 | d.vm.hostname = "onosvm" |
| 87 | d.vm.network "private_network", ip: "10.100.198.200" |
| 88 | d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
| 89 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local" |
| 90 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-dev-clean.yml -c local" |
| 91 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local" |
| 92 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/onos-install.yml -c local" |
| 93 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/machine-restart.yml -c local" |
| 94 | d.vm.provider "virtualbox" do |v| |
| 95 | v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] |
| 96 | v.memory = 4096 |
| 97 | v.cpus = 2 |
| 98 | end |
| 99 | end |
alshabib | bdb7b37 | 2016-05-25 09:46:49 -0700 | [diff] [blame] | 100 | |
Luca Prete | d8d8231 | 2017-03-23 10:26:16 -0700 | [diff] [blame] | 101 | # Creates a VM with three LXC containers inside, to be used as ONOS target machines. |
| 102 | config.vm.define "onosdev" do |d| |
| 103 | d.vm.box = "ubuntu/xenial64" |
| 104 | d.vm.hostname = "onosdev" |
| 105 | d.vm.network "private_network", ip: "10.100.198.200" |
| 106 | d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
| 107 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local" |
| 108 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local" |
| 109 | d.vm.provider "virtualbox" do |v| |
| 110 | v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] |
| 111 | v.memory = 4096 |
| 112 | v.cpus = 2 |
| 113 | end |
| 114 | end |
| 115 | |
| 116 | # Creates a VM and installs Mininet in it. |
alshabib | bdb7b37 | 2016-05-25 09:46:49 -0700 | [diff] [blame] | 117 | config.vm.define "mn" do |d| |
Luca Prete | 8d4e8bc | 2016-08-24 14:49:54 -0700 | [diff] [blame] | 118 | d.vm.box = "ubuntu/xenial64" |
alshabib | bdb7b37 | 2016-05-25 09:46:49 -0700 | [diff] [blame] | 119 | d.vm.hostname = "mn" |
| 120 | d.vm.network "private_network", ip: "10.100.198.100" |
| 121 | d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh" |
Luca Prete | 8d4e8bc | 2016-08-24 14:49:54 -0700 | [diff] [blame] | 122 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/basic.yml -c local" |
alshabib | bdb7b37 | 2016-05-25 09:46:49 -0700 | [diff] [blame] | 123 | d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/mn.yml -c local" |
| 124 | d.vm.provider "virtualbox" do |v| |
| 125 | v.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] |
| 126 | v.memory = 2048 |
| 127 | end |
| 128 | end |
| 129 | |
alshabib | 4997cd7 | 2016-05-24 22:48:29 -0700 | [diff] [blame] | 130 | end |