dragonflow/vagrant/Vagrantfile
Kyle Mestery a0f238eebf Vagrant: Add support for parallels and libvirt
This change adds support for using both parallels and libvirt as the Vagrant
hypervisor backend.

Note this change is untested, but should in theory work. Those running
Vagrant with parallels or libvirt are welcome to try this out.

Change-Id: I23511fec12238a8e3bcccea4874101d9e66c7612
Signed-off-by: Kyle Mestery <mestery@mestery.com>
2016-05-22 20:20:25 -05:00

97 lines
4.6 KiB
Ruby

# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
vagrant_config = YAML.load_file("provisioning/virtualbox.conf.yml")
Vagrant.configure(2) do |config|
config.vm.box = vagrant_config['box']
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
end
config.vm.synced_folder '..', '/dragonflow'
# Bring up the Devstack controller node on Virtualbox
config.vm.define "devstack_controller" do |devstack_controller|
devstack_controller.vm.host_name = vagrant_config['devstack_controller']['host_name']
devstack_controller.vm.network "private_network", ip: vagrant_config['devstack_controller']['ip']
devstack_controller.vm.provision "shell", path: "provisioning/setup-base.sh", privileged: false
devstack_controller.vm.provision "shell", path: "provisioning/setup-controller.sh", privileged: false
config.vm.provider "virtualbox" do |vb|
vb.memory = vagrant_config['devstack_controller']['memory']
vb.cpus = vagrant_config['devstack_controller']['cpus']
end
config.vm.provider 'parallels' do |vb, override|
vb.memory = vagrant_config['devstack_controller']['memory']
vb.cpus = vagrant_config['devstack_controller']['cpus']
vb.customize ['set', :id, '--nested-virt', 'on']
override.vm.box = ENV.fetch('VAGRANT_OVN_VM_BOX', 'boxcutter/ubuntu1404')
end
config.vm.provider 'libvirt' do |vb, override|
vb.memory = vagrant_config['devstack_controller']['memory']
vb.cpus = vagrant_config['devstack_controller']['cpus']
vb.nested = true
vb.graphics_type = 'spice'
vb.video_type = 'qxl'
override.vm.box = ENV.fetch('VAGRANT_OVN_VM_BOX', 'boxcutter/ubuntu1404')
end
end
# Bring up the Devstack compute nodes on Virtualbox
config.vm.define "devstack_compute1" do |devstack_compute1|
devstack_compute1.vm.host_name = vagrant_config['devstack_compute1']['host_name']
devstack_compute1.vm.network "private_network", ip: vagrant_config['devstack_compute1']['ip']
devstack_compute1.vm.provision "shell", path: "provisioning/setup-base.sh", privileged: false
devstack_compute1.vm.provision "shell", path: "provisioning/setup-compute.sh", privileged: false, :args => "#{vagrant_config['devstack_controller']['ip']}"
config.vm.provider "virtualbox" do |vb|
vb.memory = vagrant_config['devstack_compute1']['memory']
vb.cpus = vagrant_config['devstack_compute1']['cpus']
end
config.vm.provider 'parallels' do |vb, override|
vb.memory = vagrant_config['devstack_compute1']['memory']
vb.cpus = vagrant_config['devstack_compute1']['cpus']
vb.customize ['set', :id, '--nested-virt', 'on']
override.vm.box = ENV.fetch('VAGRANT_OVN_VM_BOX', 'boxcutter/ubuntu1404')
end
config.vm.provider 'libvirt' do |vb, override|
vb.memory = vagrant_config['devstack_compute1']['memory']
vb.cpus = vagrant_config['devstack_compute1']['cpus']
vb.nested = true
vb.graphics_type = 'spice'
vb.video_type = 'qxl'
override.vm.box = ENV.fetch('VAGRANT_OVN_VM_BOX', 'boxcutter/ubuntu1404')
end
end
config.vm.define "devstack_compute2" do |devstack_compute2|
devstack_compute2.vm.host_name = vagrant_config['devstack_compute2']['host_name']
devstack_compute2.vm.network "private_network", ip: vagrant_config['devstack_compute2']['ip']
devstack_compute2.vm.provision "shell", path: "provisioning/setup-base.sh", privileged: false
devstack_compute2.vm.provision "shell", path: "provisioning/setup-compute.sh", privileged: false, :args => "#{vagrant_config['devstack_controller']['ip']}"
config.vm.provider "virtualbox" do |vb|
vb.memory = vagrant_config['devstack_compute2']['memory']
vb.cpus = vagrant_config['devstack_compute2']['cpus']
end
config.vm.provider 'parallels' do |vb, override|
vb.memory = vagrant_config['devstack_compute2']['memory']
vb.cpus = vagrant_config['devstack_compute2']['cpus']
vb.customize ['set', :id, '--nested-virt', 'on']
override.vm.box = ENV.fetch('VAGRANT_OVN_VM_BOX', 'boxcutter/ubuntu1404')
end
config.vm.provider 'libvirt' do |vb, override|
vb.memory = vagrant_config['devstack_compute2']['memory']
vb.cpus = vagrant_config['devstack_compute2']['cpus']
vb.nested = true
vb.graphics_type = 'spice'
vb.video_type = 'qxl'
override.vm.box = ENV.fetch('VAGRANT_OVN_VM_BOX', 'boxcutter/ubuntu1404')
end
end
end