Merge pull request #2426 from tmatilai/virtualbox_memory
providers/virtualbox: Add shortcut for setting the memory size for VirtualBox VM
This commit is contained in:
commit
4e75e39ee5
|
@ -76,6 +76,14 @@ module VagrantPlugins
|
|||
@network_adapters[slot] = [type, args]
|
||||
end
|
||||
|
||||
# Shortcut for setting memory size for the virtual machine.
|
||||
# Calls #customize internally.
|
||||
#
|
||||
# @param size [Integer, String] the memory size in MB
|
||||
def memory=(size)
|
||||
customize "pre-boot", ["modifyvm", :id, "--memory", size]
|
||||
end
|
||||
|
||||
# This is the hook that is called to finalize the object before it
|
||||
# is put into use.
|
||||
def finalize!
|
||||
|
|
|
@ -61,3 +61,12 @@ more than 50% would be used on your own host machine. Some details:
|
|||
|
||||
* Multiple `customize` directives can be used. They will be executed in the
|
||||
order given.
|
||||
|
||||
There is also a shortcut for specifying the memory size (MB) for the virtual
|
||||
machine:
|
||||
|
||||
```ruby
|
||||
config.vm.provider "virtualbox" do |v|
|
||||
v.memory = 1024
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue