Skip to content
Snippets Groups Projects
Commit 36a56758 authored by Martin André's avatar Martin André
Browse files

Allow configuring number of nodes in Vagrantfile

Partially-Implements: blueprint vagrant-improvements
Change-Id: Icdf42f45dd5dec44dc02f073da0c4b863617cb1b
parent 2ee551e4
No related branches found
No related tags found
No related merge requests found
...@@ -4,9 +4,15 @@ ...@@ -4,9 +4,15 @@
# Whether to do Multi-node or All-in-One deployment # Whether to do Multi-node or All-in-One deployment
MULTINODE=true MULTINODE=true
# The following is only used when deploying in Multi-nodes
NUMBER_OF_CONTROL_NODES=3
NUMBER_OF_COMPUTE_NODES=1
NUMBER_OF_STORAGE_NODES=1
NUMBER_OF_NETWORK_NODES=1
# Configure a new SSH key and config so the operator is able to connect with # Configure a new SSH key and config so the operator is able to connect with
# the other cluster nodes. # the other cluster nodes.
if not File.file?("./vagrantkey") unless File.file?("./vagrantkey")
system("ssh-keygen -f ./vagrantkey -N '' -C this-is-vagrant") system("ssh-keygen -f ./vagrantkey -N '' -C this-is-vagrant")
end end
...@@ -62,7 +68,7 @@ Vagrant.configure(2) do |config| ...@@ -62,7 +68,7 @@ Vagrant.configure(2) do |config|
if MULTINODE if MULTINODE
# Build compute nodes # Build compute nodes
(1..1).each do |i| (1..NUMBER_OF_COMPUTE_NODES).each do |i|
config.vm.define "compute0#{i}" do |compute| config.vm.define "compute0#{i}" do |compute|
compute.vm.hostname = "compute0#{i}.local" compute.vm.hostname = "compute0#{i}.local"
compute.vm.provision :shell, path: "bootstrap.sh" compute.vm.provision :shell, path: "bootstrap.sh"
...@@ -77,7 +83,7 @@ Vagrant.configure(2) do |config| ...@@ -77,7 +83,7 @@ Vagrant.configure(2) do |config|
end end
# Build storage nodes # Build storage nodes
(1..1).each do |i| (1..NUMBER_OF_STORAGE_NODES).each do |i|
config.vm.define "storage0#{i}" do |storage| config.vm.define "storage0#{i}" do |storage|
storage.vm.hostname = "storage0#{i}.local" storage.vm.hostname = "storage0#{i}.local"
storage.vm.provision :shell, path: "bootstrap.sh" storage.vm.provision :shell, path: "bootstrap.sh"
...@@ -92,7 +98,7 @@ Vagrant.configure(2) do |config| ...@@ -92,7 +98,7 @@ Vagrant.configure(2) do |config|
end end
# Build network nodes # Build network nodes
(1..1).each do |i| (1..NUMBER_OF_NETWORK_NODES).each do |i|
config.vm.define "network0#{i}" do |network| config.vm.define "network0#{i}" do |network|
network.vm.hostname = "network0#{i}.local" network.vm.hostname = "network0#{i}.local"
network.vm.provision :shell, path: "bootstrap.sh" network.vm.provision :shell, path: "bootstrap.sh"
...@@ -107,7 +113,7 @@ Vagrant.configure(2) do |config| ...@@ -107,7 +113,7 @@ Vagrant.configure(2) do |config|
end end
# Build control nodes # Build control nodes
(1..3).each do |i| (1..NUMBER_OF_CONTROL_NODES).each do |i|
config.vm.define "control0#{i}" do |control| config.vm.define "control0#{i}" do |control|
control.vm.hostname = "control0#{i}.local" control.vm.hostname = "control0#{i}.local"
control.vm.provision :shell, path: "bootstrap.sh" control.vm.provision :shell, path: "bootstrap.sh"
...@@ -118,13 +124,6 @@ Vagrant.configure(2) do |config| ...@@ -118,13 +124,6 @@ Vagrant.configure(2) do |config|
vb.memory = 2048 vb.memory = 2048
end end
control.hostmanager.aliases = "control0#{i}" control.hostmanager.aliases = "control0#{i}"
# TODO: Here we bind local port 8080 to Horizon on control01 only.
# TODO: Once we implement Horizon behind a VIP, this obviously needs to
# be changed.
#if i < 2 then
# config.vm.network "forwarded_port", guest: 80, host: 8080
#end
end end
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment