vmonkey 0.20.0 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db1974e7ea19c2601f95522a530c92ccbc99c467
4
- data.tar.gz: e9fc72a7657ca1527ce6d97c4349d841d66b9d00
3
+ metadata.gz: 6449639ca5f21bba15a7f54c0bb88cd7789a9e7b
4
+ data.tar.gz: 4a863b9da03bff2db92c60385b7b7e4f8e52788d
5
5
  SHA512:
6
- metadata.gz: 40055176c611003390d2568ef57d641e2b87dc53b9e7c3757885dcb2f8514e6225f1167e98688886ca723b0842ea72033431f3207d58e249e705eebc2b16709b
7
- data.tar.gz: e961f6b59478ff4ee2a7bbc92832fe5c4c41c0352ff5d4a3d3445ee54c5813028fd2511efbd04617e8aee045a194e7dc4a38024b53417a5d9452dacd8e0cddf7
6
+ metadata.gz: a32c7a43c11902aacb9591c14213c6366e924435be4c07328f7543eead8ea78abe497424113352d7d1036f9f3accc08a58a0709e4d6d5cb0f6f4ef3a99d7d529
7
+ data.tar.gz: a2e2f99e45ae9c2271b14daf279fc7905ffe11d80d827af59c567d487492fdb69ae1836aeb96c20e92ff1af9367129530b1dc9f63725ef78d44b18f864128e38
@@ -1,3 +1,3 @@
1
1
  module Vmonkey
2
- VERSION = '0.20.0'
2
+ VERSION = '0.21.0'
3
3
  end
@@ -257,6 +257,7 @@ class RbVmomi::VIM::VirtualMachine
257
257
 
258
258
  def _clone_spec(dest, opts)
259
259
  opts[:config] ||= {}
260
+ opts[:vm_config_spec] ||= {}
260
261
 
261
262
  clone_spec = RbVmomi::VIM.VirtualMachineCloneSpec(
262
263
  location: RbVmomi::VIM.VirtualMachineRelocateSpec({
@@ -270,12 +271,23 @@ class RbVmomi::VIM::VirtualMachine
270
271
  device_change = opts[:deviceChange] || Array.new
271
272
  clone_spec.config = RbVmomi::VIM.VirtualMachineConfigSpec(deviceChange: device_change)
272
273
 
273
- clone_spec.customization = monkey.customization_spec(opts[:customization_spec])
274
+ if opts[:customization_spec].is_a? String
275
+ clone_spec.customization = monkey.customization_spec(opts[:customization_spec])
276
+ else
277
+ clone_spec.customization = opts[:customization_spec]
278
+ end
279
+
274
280
  clone_spec.config.annotation = opts[:config][:annotation]
275
281
  clone_spec.config.numCPUs = opts[:config][:num_cpus]
276
282
  clone_spec.config.memoryMB = opts[:config][:memory_mb]
277
283
  clone_spec.config.files = opts[:config][:files]
278
284
 
285
+ #in the long run, this replaces the opts[:config] vals and just sets via the code below
286
+ opts[:vm_config_spec].each do |key, value|
287
+ setter = "#{key}=".to_sym
288
+ clone_spec.config.send(setter, value)
289
+ end
290
+
279
291
  clone_spec
280
292
  end
281
293
 
@@ -41,6 +41,10 @@ describe RbVmomi::VIM::VirtualMachine do
41
41
  @vm_path.basename,
42
42
  @monkey.get(@vm_path.parent),
43
43
  customization_spec: VM_SPEC_OPTS[:customization_spec],
44
+ vm_config_spec: {
45
+ guestId: 'rhel5_64Guest',
46
+ nestedHVEnabled: true
47
+ },
44
48
  config: {
45
49
  annotation: 'an annotation',
46
50
  num_cpus: 3,
@@ -55,6 +59,8 @@ describe RbVmomi::VIM::VirtualMachine do
55
59
  it { expect(subject[:spec].config.memoryMB).to eq 1024 }
56
60
  it { expect(subject[:spec].config.files[:vmPathName]). to eq "#{VM_SPEC_OPTS[:datastore]} vmonkey-test" }
57
61
  it { expect(subject[:spec].config.deviceChange.length).to be 0}
62
+ it { expect(subject[:spec].config.guestId).to eq 'rhel5_64Guest'}
63
+ it { expect(subject[:spec].config.nestedHVEnabled).to be true}
58
64
  end
59
65
 
60
66
  context 'with datastore change' do
@@ -269,4 +275,4 @@ describe RbVmomi::VIM::VirtualMachine do
269
275
  end
270
276
  end
271
277
 
272
- end
278
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmonkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dupras
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-18 00:00:00.000000000 Z
13
+ date: 2015-03-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri