Refactor vagrant configuration

Unified the compute nodes in the vagrant file
Renamed the configuration file to dragonflow.conf.yml (from
virtualbox.conf.yml) as it is now not hypervisor-specific

Change-Id: I66ca9c8d60f2ef64fb9c38c6b73187e19803b539
This commit is contained in:
Shachar Snapiri 2018-01-09 09:31:03 +02:00
parent 8ea8e3fd98
commit 64ce5f452d
3 changed files with 22 additions and 39 deletions

View File

@ -44,7 +44,7 @@ Quick Start
vagrant plugin install vagrant-cachier
vagrant plugin install vagrant-vbguest
3. Adjust the settings in `vagrant/provisioning/virtualbox.conf.yml` if needed (5GB RAM is the
3. Adjust the settings in `vagrant/provisioning/dragonflow.conf.yml` if needed (5GB RAM is the
minimum to get 1 VM running on the controller node)
4. Launch the VM's: `vagrant up`

59
vagrant/Vagrantfile vendored
View File

@ -12,7 +12,7 @@ ENV['VAGRANT_NO_PARALLEL'] = 'yes'
require 'yaml'
vagrant_config = YAML.load_file("provisioning/virtualbox.conf.yml")
vagrant_config = YAML.load_file("provisioning/dragonflow.conf.yml")
Vagrant.configure(2) do |config|
config.vm.box = vagrant_config['box']
@ -34,7 +34,7 @@ Vagrant.configure(2) do |config|
override.vm.box = ENV.fetch('VAGRANT_OVN_VM_BOX', 'generic/ubuntu1604')
end
# Bring up the Devstack controller node on Virtualbox
# Bring up the Devstack controller node on the hypervisor
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']
@ -55,44 +55,27 @@ Vagrant.configure(2) do |config|
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']}"
# Bring up the Devstack compute nodes on the hypervisor
(1..2).each do |i|
config.vm.define "devstack_compute#{i}" do |devstack_compute|
devstack_compute.vm.host_name = vagrant_config["devstack_compute#{i}"]['host_name']
devstack_compute.vm.network "private_network", ip: vagrant_config["devstack_compute#{i}"]['ip']
devstack_compute.vm.provision "shell", path: "provisioning/setup-base.sh", privileged: false
devstack_compute.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|
vb.memory = vagrant_config['devstack_compute1']['memory']
vb.cpus = vagrant_config['devstack_compute1']['cpus']
end
config.vm.provider 'libvirt' do |vb|
vb.memory = vagrant_config['devstack_compute1']['memory']
vb.cpus = vagrant_config['devstack_compute1']['cpus']
config.vm.provider "virtualbox" do |vb|
vb.memory = vagrant_config["devstack_compute#{i}"]['memory']
vb.cpus = vagrant_config["devstack_compute#{i}"]['cpus']
end
config.vm.provider 'parallels' do |vb|
vb.memory = vagrant_config["devstack_compute#{i}"]['memory']
vb.cpus = vagrant_config["devstack_compute#{i}"]['cpus']
end
config.vm.provider 'libvirt' do |vb|
vb.memory = vagrant_config["devstack_compute#{i}"]['memory']
vb.cpus = vagrant_config["devstack_compute#{i}"]['cpus']
end
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|
vb.memory = vagrant_config['devstack_compute2']['memory']
vb.cpus = vagrant_config['devstack_compute2']['cpus']
end
config.vm.provider 'libvirt' do |vb|
vb.memory = vagrant_config['devstack_compute2']['memory']
vb.cpus = vagrant_config['devstack_compute2']['cpus']
end
end
end