From 3dd14e5e3743bae3f9dd2eb360a454536869ab73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 27 Apr 2015 19:01:02 +0200 Subject: [PATCH] Ability to configure the memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- Vagrantfile | 21 +++++++++++---------- vagrant_variables.yml.sample | 3 +++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 064601ac9..b01ce610f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -14,6 +14,7 @@ NRGWS = settings['rgw_vms'] CLIENTS = settings['client_vms'] SUBNET = settings['subnet'] BOX = settings['vagrant_box'] +MEMORY = settings['memory'] ansible_provision = proc do |ansible| ansible.playbook = 'site.yml' @@ -73,10 +74,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| client.vm.hostname = "ceph-client#{i}" client.vm.network :private_network, ip: "#{SUBNET}.4#{i}" client.vm.provider :virtualbox do |vb| - vb.customize ['modifyvm', :id, '--memory', '192'] + vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"] end client.vm.provider :vmware_fusion do |v| - v.vmx['memsize'] = '192' + v.vmx['memsize'] = "#{MEMORY}" end end end @@ -86,10 +87,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| rgw.vm.hostname = "ceph-rgw#{i}" rgw.vm.network :private_network, ip: "#{SUBNET}.4#{i}" rgw.vm.provider :virtualbox do |vb| - vb.customize ['modifyvm', :id, '--memory', '192'] + vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"] end rgw.vm.provider :vmware_fusion do |v| - v.vmx['memsize'] = '192' + v.vmx['memsize'] = "#{MEMORY}" end end end @@ -99,10 +100,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| rgw.vm.hostname = "ceph-mds#{i}" rgw.vm.network :private_network, ip: "#{SUBNET}.7#{i}" rgw.vm.provider :virtualbox do |vb| - vb.customize ['modifyvm', :id, '--memory', '192'] + vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"] end rgw.vm.provider :vmware_fusion do |v| - v.vmx['memsize'] = '192' + v.vmx['memsize'] = "#{MEMORY}" end end end @@ -112,10 +113,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| mon.vm.hostname = "ceph-mon#{i}" mon.vm.network :private_network, ip: "#{SUBNET}.1#{i}" mon.vm.provider :virtualbox do |vb| - vb.customize ['modifyvm', :id, '--memory', '192'] + vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"] end mon.vm.provider :vmware_fusion do |v| - v.vmx['memsize'] = '192' + v.vmx['memsize'] = "#{MEMORY}" end end end @@ -140,7 +141,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| '--type', 'hdd', '--medium', "disk-#{i}-#{d}.vdi"] end - vb.customize ['modifyvm', :id, '--memory', '192'] + vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"] end osd.vm.provider :vmware_fusion do |v| (0..1).each do |d| @@ -148,7 +149,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.vmx["scsi0:#{d + 1}.fileName"] = create_vmdk("disk-#{i}-#{d}", '11000MB') end - v.vmx['memsize'] = '192' + v.vmx['memsize'] = "#{MEMORY}" end # Run the provisioner after the last machine comes up diff --git a/vagrant_variables.yml.sample b/vagrant_variables.yml.sample index 225244751..ee0474d09 100644 --- a/vagrant_variables.yml.sample +++ b/vagrant_variables.yml.sample @@ -10,6 +10,9 @@ client_vms: 0 # SUBNET TO USE FOR THE VMS subnet: 192.168.42 +# MEMORY +memory: 256 + # VAGRANT BOX # Fedora: http://download.fedoraproject.org/pub/fedora/linux/releases/test/22_Alpha/Cloud/x86_64/Images/Fedora-Cloud-Atomic-Vagrant-22_Alpha-20150305.x86_64.vsphere.ova # Ubuntu: ubuntu/trusty