-
-
Save joshribakoff/e3ae59373f58b31f79b5cdf41f83ca2e to your computer and use it in GitHub Desktop.
Local file override for Memory/CPU limits in Vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby | |
if File.exists?('./Vagrantfile.override.rb') | |
require_relative './Vagrantfile.override.rb' | |
end | |
# Defaults for CPU and Memory | |
CPUS ||= 1 | |
MEMORY ||= 1024 | |
Vagrant.configure('2') do |config| | |
[:parallels, :virtualbox].each do |provider| | |
config.vm.provider provider do |vm, override| | |
vm.cpus = ::CPUS | |
vm.memory = ::MEMORY | |
end | |
end | |
[:vmware_workstation, :vmware_fusion].each do |provider| | |
config.vm.provider provider do |vm, override| | |
vm.vmx[:numvcpus] = ::CPUS | |
vm.vmx[:memsize] = ::MEMORY | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MEMORY = 2048 | |
CPUS = 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment