aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-bootstrap/Vagrantfile
diff options
context:
space:
mode:
authorRay Kinsella <ray.kinsella@intel.com>2016-11-15 17:22:51 +0000
committerRay Kinsella <ray.kinsella@intel.com>2016-11-21 13:04:59 +0000
commit58fda365c5c9281eaddd1867d0456625349cef44 (patch)
treea0ebb34dc1553081c46cacc22d967e8435fe437e /vpp-bootstrap/Vagrantfile
parent08e0618fef8173d3c94d64bce69f34d26f6a1f1c (diff)
vpp-bootstrap: initial commit
vpp-bootstrap is a vagrant based tool to automatically bootstrap a vpp development environment. The tool is designed to be as data-driven and extensible. * An Ubuntu environment featuring one or more containers connected via a Linux bridge is created. * New containers can be easily created, packages install and configured via a provisioning scripts. * Networking, auth credentials and hostnames are automatically configured to enable using tools like ssh and scp without password and ip addresses. * Support for vagrant-proxy and vagrant-aws provisioning. * Two containers are initially provided:- * The first container provides network test tools such as scapy are automatically installed * In the second container VPP-lite is automatically git cloned, built and installed. Change-Id: Id484431f7dde8fdc9ff25ad198ff3cec55ba112c Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
Diffstat (limited to 'vpp-bootstrap/Vagrantfile')
-rw-r--r--vpp-bootstrap/Vagrantfile103
1 files changed, 103 insertions, 0 deletions
diff --git a/vpp-bootstrap/Vagrantfile b/vpp-bootstrap/Vagrantfile
new file mode 100644
index 0000000..9438156
--- /dev/null
+++ b/vpp-bootstrap/Vagrantfile
@@ -0,0 +1,103 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+# Copyright (c) 2016 Intel Corporation
+
+Vagrant.configure(2) do |config|
+
+ # Pick the right distro and bootstrap, default is ubuntu1404
+ config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
+ vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 8)
+ vmram=(ENV['VPP_VAGRANT_VMRAM'] || 16384)
+
+ # Define some physical ports for your VMs to be used by DPDK
+ config.vm.network "private_network", type: "dhcp"
+
+ config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"provision.sh") , privileged: false
+
+ # vagrant-cachier caches apt/yum etc to speed subsequent
+ # vagrant up
+ # to enable, run
+ # vagrant plugin install vagrant-cachier
+ #
+ if Vagrant.has_plugin?("vagrant-cachier")
+ config.cache.scope = :box
+ end
+
+ # use http proxy if avaiable
+ if ENV['http_proxy'] && Vagrant.has_plugin?("vagrant-proxyconf")
+ config.proxy.http = ENV['http_proxy']
+ config.proxy.https = ENV['https_proxy']
+ config.proxy.no_proxy = "localhost,127.0.0.1"
+ end
+
+ config.vm.provider :aws do |aws, override|
+ #disable any corporate proxies in the AWS cloud
+ if Vagrant.has_plugin?("vagrant-proxyconf")
+ override.proxy.enabled = false
+ end
+
+ #Use rsync instead of nfs to sync folders.
+ override.vm.synced_folder ".", "/vagrant", type: "rsync",
+ rsync__exclude: ".git/"
+
+ #We don't need a local box, use the vagrant-aws dummy instead
+ override.vm.box = "dummy"
+
+ #These are the credentials required to access AWS Instructure.
+ #vagrant-aws requires these to create the new instance.
+ #These can either be your AWS root account access key (not recommended)
+ #or an IAM user with sufficent rights to create EC2 instances.
+ aws.access_key_id = "abcdefg"
+ aws.secret_access_key = "abcdefg"
+
+ #Your preferred region, Ireland is always a good choice.
+ aws.region = "eu-west-1"
+
+ #The EC2 keypair used to provision remote access creds in the
+ #newly created EC2 instance. These creds permit remote access via ssh.
+ aws.keypair_name = "ec2"
+
+ #Security groups (ACLs) to provision new EC2 instance with.
+ #At least one of the security groups should allow SSH.
+ #to enable `vagrant ssh` to work.
+ aws.security_groups = [ "permit-ssh", "default" ]
+
+ #Amazon Machine Instance (AMI) to use, default is Ubuntu Trusty (HVM).
+ aws.ami = "ami-0c59f37f"
+
+ #EC2 instance type (how much cpu/mem resources to give the instance).
+ aws.instance_type = "t2.micro"
+
+ #Any proxy command required for ssh to workaround corporate firewalls
+ #override.ssh.proxy_command = "nc -x proxy.com:1080 %h %p"
+
+ #Ubuntu AMIs use ubuntu as the default username, not vagrant.
+ override.ssh.username = "ubuntu"
+
+ #Private key to access new EC2 instance via SSH, should be the private
+ #key from the keypair_name created above.
+ override.ssh.private_key_path = "/root/private_key.pem"
+ end
+ config.vm.provider "virtualbox" do |vb|
+ vb.name = "vpp-bootstrap"
+
+ vb.customize ["modifyvm", :id, "--ioapic", "on"]
+ vb.memory = "#{vmram}"
+ vb.cpus = "#{vmcpu}"
+
+ vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"]
+ vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"]
+ end
+ config.vm.provider "vmware_fusion" do |fusion,override|
+ fusion.vmx["memsize"] = "#{vmram}"
+ fusion.vmx["numvcpus"] = "#{vmcpu}"
+ end
+ config.vm.provider "libvirt" do |lv|
+ lv.memory = "#{vmram}"
+ lv.cpus = "#{vmcpu}"
+ end
+ config.vm.provider "vmware_workstation" do |vws,override|
+ vws.vmx["memsize"] = "#{vmram}"
+ vws.vmx["numvcpus"] = "#{vmcpu}"
+ end
+end