blob: e6f124c9713cb10b139fad7a2695dd41df6f1a11 [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|
4 config.vm.box = "bento/ubuntu-16.04"
5 config.vm.provider "virtualbox" do |vb|
Carmelo Casconec5569c22018-04-18 10:09:15 +09006 vb.name = "ONOS+P4 " + P4_VM_TYPE + " " + Time.now.strftime("(%Y-%m-%d)")
Carmelo Casconed6615072017-12-15 00:53:43 -08007 vb.gui = true
Carmelo Casconec5569c22018-04-18 10:09:15 +09008 vb.cpus = P4_VM_TYPE == "tutorial" ? 4 : 2
Carmelo Casconed6615072017-12-15 00:53:43 -08009 vb.memory = 4096
Carmelo Casconec5569c22018-04-18 10:09:15 +090010 if P4_VM_TYPE == "tutorial"
11 vb.customize ["storageattach", :id,
12 "--storagectl", "IDE Controller",
13 "--port", "0", "--device", "1",
14 "--type", "dvddrive",
15 "--medium", "emptydrive"]
16 vb.customize ['modifyvm', :id, '--clipboard', 'bidirectional']
17 end
Carmelo Casconed6615072017-12-15 00:53:43 -080018 end
Carmelo Casconec5569c22018-04-18 10:09:15 +090019 config.vm.hostname = "onos-p4-" + P4_VM_TYPE
Carmelo Casconed6615072017-12-15 00:53:43 -080020 # By default vagrant creates a NAT interface.
21 # Create a second one host-only.
22 config.vm.network "private_network", :type => 'dhcp', :adapter => 2
Carmelo Casconec5569c22018-04-18 10:09:15 +090023 config.vm.provision "shell", path: "root-bootstrap.sh", :args => P4_VM_TYPE
Carmelo Casconed6615072017-12-15 00:53:43 -080024end