Last active
January 9, 2020 13:44
-
-
Save stephenreay/2afd4205e76836f20e17672238a10957 to your computer and use it in GitHub Desktop.
Local file override for Memory/CPU limits in Vagrant
This file contains hidden or 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 hidden or 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
Thanks!