Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8 from frapposelli/master
Browse files Browse the repository at this point in the history
Add shortcut options `memory` and `cpus` to provider configuration.
  • Loading branch information
frapposelli committed Jul 2, 2015
2 parents bc591c8 + 91fe9c1 commit ad042d8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Vagrant.configure('2') do |config|

# Configure our boxes with 1 CPU and 384MB of RAM
config.vm.provider 'vmware_appcatalyst' do |v|
v.vmx['numvcpus'] = '1'
v.vmx['memsize'] = '384'
v.cpus = '1'
v.memory = '384'
end

# Go through nodes and configure each of them.j
Expand Down
12 changes: 12 additions & 0 deletions lib/vagrant-vmware-appcatalyst/action/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ def call(env)
"#{env[:machine].data_dir}/#{uuid}/*.vmx"
).first

env[:appcatalyst_cnx].set_vmx_value(
vmx_file,
'memsize',
env[:machine].provider_config.memory
) unless env[:machine].provider_config.memory.empty?

env[:appcatalyst_cnx].set_vmx_value(
vmx_file,
'numvcpus',
env[:machine].provider_config.cpus
) unless env[:machine].provider_config.cpus.empty?

# Make sure we use Virtual HW 11
env[:appcatalyst_cnx].set_vmx_value(vmx_file, 'virtualHW.version', '11')

Expand Down
10 changes: 10 additions & 0 deletions lib/vagrant-vmware-appcatalyst/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ class Config < Vagrant.plugin('2', :config)
# @return [Hash]
attr_accessor :vmx

# Shortcut to set memory in the VM
#
# @return [String]
attr_accessor :memory

# Shortcut to set cpus in the VM
#
# @return [String]
attr_accessor :cpus

# REST API daemon port, default 8080
#
# @return [String]
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-vmware-appcatalyst/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

module VagrantPlugins
module AppCatalyst
VERSION = '1.0.1'
VERSION = '1.0.2'
end
end

0 comments on commit ad042d8

Please sign in to comment.