Add option set number of CPUs
This commit is contained in:
parent
5823b3a1c5
commit
f2def8b81d
14
Vagrantfile
vendored
14
Vagrantfile
vendored
@ -32,6 +32,8 @@ SLAVES_COUNT = cfg["slaves_count"]
|
||||
SLAVES_RAM = cfg["slaves_ram"]
|
||||
MASTER_RAM = cfg["master_ram"]
|
||||
SYNC_TYPE = cfg["sync_type"]
|
||||
MASTER_CPUS = cfg["master_cpus"]
|
||||
SLAVES_CPUS = cfg["slaves_cpus"]
|
||||
|
||||
def ansible_playbook_command(filename, args=[])
|
||||
"ansible-playbook -v -i \"localhost,\" -c local /vagrant/bootstrap/playbooks/#{filename} #{args.join ' '}"
|
||||
@ -58,10 +60,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
config.vm.host_name = "solar-dev"
|
||||
|
||||
config.vm.provider :virtualbox do |v|
|
||||
v.memory = MASTER_RAM
|
||||
v.cpus = MASTER_CPUS
|
||||
v.customize [
|
||||
"modifyvm", :id,
|
||||
"--memory", MASTER_RAM,
|
||||
"--paravirtprovider", "kvm" # for linux guest
|
||||
"--cpus", MASTER_CPUS,
|
||||
"--paravirtprovider", "kvm", # for linux guest
|
||||
"--ioapic", "on",
|
||||
]
|
||||
v.name = "solar-dev"
|
||||
end
|
||||
@ -69,6 +75,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
config.vm.provider :libvirt do |libvirt|
|
||||
libvirt.driver = 'kvm'
|
||||
libvirt.memory = MASTER_RAM
|
||||
libvirt.cpus = MASTER_CPUS
|
||||
libvirt.nested = true
|
||||
libvirt.cpu_mode = 'host-passthrough'
|
||||
libvirt.volume_cache = 'unsafe'
|
||||
@ -101,7 +108,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
v.customize [
|
||||
"modifyvm", :id,
|
||||
"--memory", SLAVES_RAM,
|
||||
"--paravirtprovider", "kvm" # for linux guest
|
||||
"--cpus", SLAVES_CPUS,
|
||||
"--paravirtprovider", "kvm", # for linux guest
|
||||
"--ioapic", "on",
|
||||
]
|
||||
v.name = "solar-dev#{index}"
|
||||
end
|
||||
@ -109,6 +118,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
config.vm.provider :libvirt do |libvirt|
|
||||
libvirt.driver = 'kvm'
|
||||
libvirt.memory = SLAVES_RAM
|
||||
libvirt.cpus = SLAVES_CPUS
|
||||
libvirt.nested = true
|
||||
libvirt.cpu_mode = 'host-passthrough'
|
||||
libvirt.volume_cache = 'unsafe'
|
||||
|
@ -4,6 +4,8 @@
|
||||
slaves_count: 2
|
||||
slaves_ram: 1024
|
||||
master_ram: 1024
|
||||
master_cpus: 1
|
||||
slaves_cpus: 1
|
||||
# By default Virtualbox shared folder is used which is very slow
|
||||
# Uncomment following option to change it.
|
||||
# Possible options are: rsync, nfs
|
||||
|
Loading…
x
Reference in New Issue
Block a user