Make memory and cpu configurable in Vagrant
Fixes
# -*- mode: ruby -*-
# vi: set ft=ruby :
+# Mem in Mib allocated to each server VM
+NODE_MEM = (ENV['NODE_MEM'] || 6144).freeze
+# Num CPUs allocated to each server VM
+NODE_CPU = (ENV['NODE_CPU'] || 8).freeze
+
+# Mem in Mib allocated to the iSCSI server VM
+ISCSI_MEM = (ENV['ISCSI_MEM'] || 1024).freeze
+# Num CPUs allocated to the iSCSI server VM
+ISCSI_CPU = (ENV['ISCSI_CPU'] || 4).freeze
+
require 'open3'
require 'fileutils'
@@ -22,8 +32,8 @@ Vagrant.configure('2') do |config|
config.vm.provider 'virtualbox' do |vbx|
vbx.linked_clone = true
- vbx.memory = 1024
- vbx.cpus = 4
+ vbx.memory = NODE_MEM
+ vbx.cpus = NODE_CPU
vbx.customize ['modifyvm', :id, '--audio', 'none']
end
@@ -66,8 +76,8 @@ Vagrant.configure('2') do |config|
iscsi.vm.hostname = 'iscsi.local'
iscsi.vm.provider 'virtualbox' do |vbx|
- vbx.memory = 512
- vbx.cpus = 2
+ vbx.memory = ISCSI_MEM
+ vbx.cpus = ISCSI_CPU
end
provision_iscsi_net iscsi, '10'
