Merge pull request #256 from leseb/vagrant-var-memory

Ability to configure the memory
pull/251/head
Leseb 2015-04-27 19:02:42 +02:00
commit c2a50e2857
2 changed files with 14 additions and 10 deletions

21
Vagrantfile vendored
View File

@ -14,6 +14,7 @@ NRGWS = settings['rgw_vms']
CLIENTS = settings['client_vms'] CLIENTS = settings['client_vms']
SUBNET = settings['subnet'] SUBNET = settings['subnet']
BOX = settings['vagrant_box'] BOX = settings['vagrant_box']
MEMORY = settings['memory']
ansible_provision = proc do |ansible| ansible_provision = proc do |ansible|
ansible.playbook = 'site.yml' ansible.playbook = 'site.yml'
@ -73,10 +74,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
client.vm.hostname = "ceph-client#{i}" client.vm.hostname = "ceph-client#{i}"
client.vm.network :private_network, ip: "#{SUBNET}.4#{i}" client.vm.network :private_network, ip: "#{SUBNET}.4#{i}"
client.vm.provider :virtualbox do |vb| client.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', '192'] vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
end end
client.vm.provider :vmware_fusion do |v| client.vm.provider :vmware_fusion do |v|
v.vmx['memsize'] = '192' v.vmx['memsize'] = "#{MEMORY}"
end end
end end
end end
@ -86,10 +87,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
rgw.vm.hostname = "ceph-rgw#{i}" rgw.vm.hostname = "ceph-rgw#{i}"
rgw.vm.network :private_network, ip: "#{SUBNET}.4#{i}" rgw.vm.network :private_network, ip: "#{SUBNET}.4#{i}"
rgw.vm.provider :virtualbox do |vb| rgw.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', '192'] vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
end end
rgw.vm.provider :vmware_fusion do |v| rgw.vm.provider :vmware_fusion do |v|
v.vmx['memsize'] = '192' v.vmx['memsize'] = "#{MEMORY}"
end end
end end
end end
@ -99,10 +100,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
rgw.vm.hostname = "ceph-mds#{i}" rgw.vm.hostname = "ceph-mds#{i}"
rgw.vm.network :private_network, ip: "#{SUBNET}.7#{i}" rgw.vm.network :private_network, ip: "#{SUBNET}.7#{i}"
rgw.vm.provider :virtualbox do |vb| rgw.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', '192'] vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
end end
rgw.vm.provider :vmware_fusion do |v| rgw.vm.provider :vmware_fusion do |v|
v.vmx['memsize'] = '192' v.vmx['memsize'] = "#{MEMORY}"
end end
end end
end end
@ -112,10 +113,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
mon.vm.hostname = "ceph-mon#{i}" mon.vm.hostname = "ceph-mon#{i}"
mon.vm.network :private_network, ip: "#{SUBNET}.1#{i}" mon.vm.network :private_network, ip: "#{SUBNET}.1#{i}"
mon.vm.provider :virtualbox do |vb| mon.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', '192'] vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
end end
mon.vm.provider :vmware_fusion do |v| mon.vm.provider :vmware_fusion do |v|
v.vmx['memsize'] = '192' v.vmx['memsize'] = "#{MEMORY}"
end end
end end
end end
@ -140,7 +141,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
'--type', 'hdd', '--type', 'hdd',
'--medium', "disk-#{i}-#{d}.vdi"] '--medium', "disk-#{i}-#{d}.vdi"]
end end
vb.customize ['modifyvm', :id, '--memory', '192'] vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
end end
osd.vm.provider :vmware_fusion do |v| osd.vm.provider :vmware_fusion do |v|
(0..1).each do |d| (0..1).each do |d|
@ -148,7 +149,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
v.vmx["scsi0:#{d + 1}.fileName"] = v.vmx["scsi0:#{d + 1}.fileName"] =
create_vmdk("disk-#{i}-#{d}", '11000MB') create_vmdk("disk-#{i}-#{d}", '11000MB')
end end
v.vmx['memsize'] = '192' v.vmx['memsize'] = "#{MEMORY}"
end end
# Run the provisioner after the last machine comes up # Run the provisioner after the last machine comes up

View File

@ -10,6 +10,9 @@ client_vms: 0
# SUBNET TO USE FOR THE VMS # SUBNET TO USE FOR THE VMS
subnet: 192.168.42 subnet: 192.168.42
# MEMORY
memory: 256
# VAGRANT BOX # 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 # 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 # Ubuntu: ubuntu/trusty