blob: 259e380444c563ffbd81443e2b59865e114c98b3 [file] [log] [blame]
Carmelo Casconec5569c22018-04-18 10:09:15 +09001P4_VM_TYPE = ENV['P4_VM_TYPE'] || "dev"
2
Carmelo Casconed6615072017-12-15 00:53:43 -08003Vagrant.configure(2) do |config|
Carmelo Casconeea2c1102018-08-21 18:32:58 -07004 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 Casconed6615072017-12-15 00:53:43 -08009 config.vm.provider "virtualbox" do |vb|
Carmelo Casconec5569c22018-04-18 10:09:15 +090010 vb.name = "ONOS+P4 " + P4_VM_TYPE + " " + Time.now.strftime("(%Y-%m-%d)")
Carmelo Casconed6615072017-12-15 00:53:43 -080011 vb.gui = true
Carmelo Casconec5569c22018-04-18 10:09:15 +090012 vb.cpus = P4_VM_TYPE == "tutorial" ? 4 : 2
Carmelo Casconed6615072017-12-15 00:53:43 -080013 vb.memory = 4096
Carmelo Casconec5569c22018-04-18 10:09:15 +090014 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 Casconed6615072017-12-15 00:53:43 -080022 end
Carmelo Casconec5569c22018-04-18 10:09:15 +090023 config.vm.hostname = "onos-p4-" + P4_VM_TYPE
Carmelo Casconed6615072017-12-15 00:53:43 -080024 config.vm.network "private_network", :type => 'dhcp', :adapter => 2
Carmelo Casconec5569c22018-04-18 10:09:15 +090025 config.vm.provision "shell", path: "root-bootstrap.sh", :args => P4_VM_TYPE
Carmelo Casconed6615072017-12-15 00:53:43 -080026end