From 931c9152d86c50f80d110eb923418c6a9aecb978 Mon Sep 17 00:00:00 2001 From: Darren Birkett Date: Thu, 30 Jan 2014 10:21:04 +0000 Subject: [PATCH] Add Vagrantfile-aio-neutron Implements: blueprint reference-havana-vagrant - Add a working vagrantfile and environment file for a working allinone using neutron as the networking component, and openvswitch as the neutron plugin Change-Id: Ib7743dc2b822176d5c9e63396182ec7dfa9de7be --- Vagrantfile-aio-neutron | 90 +++++++++++++++++++++++++++ environments/vagrant-aio-neutron.json | 41 ++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 Vagrantfile-aio-neutron create mode 100644 environments/vagrant-aio-neutron.json diff --git a/Vagrantfile-aio-neutron b/Vagrantfile-aio-neutron new file mode 100644 index 0000000..b056394 --- /dev/null +++ b/Vagrantfile-aio-neutron @@ -0,0 +1,90 @@ +# to use this vagrantfile, do either one of the following (not both): +# 1) export VAGRANT_VAGRANTFILE=Vagrantfile-aio-neutron +# 2) mv Vagrantfile-aio-neutron Vagrantfile +# +# and then use as normal: +# vagrant up centos65 +# AND/OR +# vagrant up ubuntu1204 + +Vagrant.require_version ">= 1.1" + +Vagrant.require_plugin "vagrant-berkshelf" +Vagrant.require_plugin "vagrant-chef-zero" +Vagrant.require_plugin "vagrant-omnibus" + +Vagrant.configure("2") do |config| + # Berkshelf plugin configuration + config.berkshelf.enabled = true + + # Chef-Zero plugin configuration + config.chef_zero.enabled = true + config.chef_zero.chef_repo_path = "." + + # Omnibus plugin configuration + config.omnibus.chef_version = :latest + + # get local ip so that we can force chef zero onto a different port per + # machine, allowing for multiple simultaneous vagrant up runs + local_ip = Socket.ip_address_list.detect{|intf| intf.ipv4_private?}.ip_address + + # OpenStack-related settings + config.vm.network "private_network", ip: "192.168.100.60" + chef_environment = "vagrant-aio-neutron" + chef_run_list = [ "role[allinone-compute]","role[os-image-upload]" ] + + # virtualbox provider settings + config.vm.provider "virtualbox" do |vb| + vb.customize ["modifyvm", :id, "--cpus", 2] + vb.customize ["modifyvm", :id, "--memory", 2048] + vb.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] + end + + ####################### + # Ubuntu 12.04 # + ####################### + + config.vm.define :ubuntu1204 do |ubuntu1204| + + ubuntu1204.vm.hostname = "ubuntu1204" + + ubuntu1204.vm.box = "opscode-ubuntu-12.04" + + ubuntu1204.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box" + + ubuntu1204.vm.network "forwarded_port", guest: 443, host: 8443 # dashboard-ssl + ubuntu1204.vm.network "forwarded_port", guest: 8773, host: 8773 # compute-ec2-api + ubuntu1204.vm.network "forwarded_port", guest: 8774, host: 8774 # compute-api + ubuntu1204.vm.network "forwarded_port", guest: 4002, host: 4002 # chef-zero + + ubuntu1204.vm.provision :chef_client do |chef| + chef.environment = chef_environment + chef.run_list = chef_run_list.unshift("recipe[apt::cacher-client]") + chef.chef_server_url = "http://#{local_ip}:4002" + end + end + + ####################### + # Centos 6.5 # + ####################### + + config.vm.define :centos65 do |centos65| + + centos65.vm.hostname = "centos65" + + centos65.vm.box = "opscode-centos-6.5" + + centos65.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box" + + centos65.vm.network "forwarded_port", guest: 443, host: 9443 # dashboard-ssl + centos65.vm.network "forwarded_port", guest: 8773, host: 9773 # compute-ec2-api + centos65.vm.network "forwarded_port", guest: 8774, host: 9774 # compute-api + centos65.vm.network "forwarded_port", guest: 4001, host: 4001 # chef-zero + + centos65.vm.provision :chef_client do |chef| + chef.environment = chef_environment + chef.run_list = chef_run_list + chef.chef_server_url = "http://#{local_ip}:4001" + end + end +end diff --git a/environments/vagrant-aio-neutron.json b/environments/vagrant-aio-neutron.json new file mode 100644 index 0000000..2ef75e8 --- /dev/null +++ b/environments/vagrant-aio-neutron.json @@ -0,0 +1,41 @@ +{ + "name": "vagrant-aio-neutron", + "description": "Environment used in testing the upstream cookbooks and reference Chef repository with vagrant. To be used with the Vagrantfile-aio-neutron vagrantfile. Defines the necessary attributes for a working all-in-one openstack deployment, using neutron for the networking component, and the openvswitch neutron plugin", + "cookbook_versions": { + }, + "json_class": "Chef::Environment", + "chef_type": "environment", + "default_attributes": { + }, + "override_attributes": { + "openstack": { + "developer_mode": true, + "network": { + "openvswitch": { + "local_ip_interface": "eth1" + } + }, + "image": { + "image_upload": true, + "upload_images": [ + "cirros" + ], + "upload_image": { + "cirros": "https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img" + } + }, + "compute": { + "network": { + "public_interface": "eth1", + "service_type": "neutron" + }, + "config": { + "ram_allocation_ratio": 5.0 + }, + "libvirt": { + "virt_type": "qemu" + } + } + } + } +}