vmonkey 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vmonkey/version.rb +1 -1
- data/lib/vmonkey/vim/VirtualMachine.rb +13 -1
- data/spec/virtualmachine_spec.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6449639ca5f21bba15a7f54c0bb88cd7789a9e7b
|
4
|
+
data.tar.gz: 4a863b9da03bff2db92c60385b7b7e4f8e52788d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a32c7a43c11902aacb9591c14213c6366e924435be4c07328f7543eead8ea78abe497424113352d7d1036f9f3accc08a58a0709e4d6d5cb0f6f4ef3a99d7d529
|
7
|
+
data.tar.gz: a2e2f99e45ae9c2271b14daf279fc7905ffe11d80d827af59c567d487492fdb69ae1836aeb96c20e92ff1af9367129530b1dc9f63725ef78d44b18f864128e38
|
data/lib/vmonkey/version.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/spec/virtualmachine_spec.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|