Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 1 | P4_VM_TYPE = ENV['P4_VM_TYPE'] || "dev" |
| 2 | |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 3 | Vagrant.configure(2) do |config| |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 4 | if P4_VM_TYPE == "tutorial" |
| 5 | config.vm.box = "fso/xenial64-desktop" |
| 6 | else |
| 7 | config.vm.box = "bento/ubuntu-16.04" |
| 8 | end |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 9 | config.vm.provider "virtualbox" do |vb| |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 10 | vb.name = "ONOS+P4 " + P4_VM_TYPE + " " + Time.now.strftime("(%Y-%m-%d)") |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 11 | vb.gui = true |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 12 | vb.cpus = P4_VM_TYPE == "tutorial" ? 4 : 2 |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 13 | vb.memory = 4096 |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 14 | if P4_VM_TYPE == "tutorial" |
| 15 | vb.customize ["storageattach", :id, |
| 16 | "--storagectl", "IDE Controller", |
| 17 | "--port", "0", "--device", "1", |
| 18 | "--type", "dvddrive", |
| 19 | "--medium", "emptydrive"] |
| 20 | vb.customize ['modifyvm', :id, '--clipboard', 'bidirectional'] |
| 21 | end |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 22 | end |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 23 | config.vm.hostname = "onos-p4-" + P4_VM_TYPE |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 24 | config.vm.network "private_network", :type => 'dhcp', :adapter => 2 |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 25 | config.vm.provision "shell", path: "root-bootstrap.sh", :args => P4_VM_TYPE |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 26 | end |