clc-chef-metal-vsphere 0.3.31 → 0.3.32

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: 8c0a832a001dd11d0b5e528c774c8edb18f1c328
4
- data.tar.gz: bf3b36cfa4761769d860054296e1a00228aed047
3
+ metadata.gz: dd00184db58d16015203e91e92cd82447b24aa63
4
+ data.tar.gz: bbee8ee23bad1d04376dec8cc403db3dee9de282
5
5
  SHA512:
6
- metadata.gz: 4f00a35cef49d0ea625a0d54f6fb2c01654700c262038f53aa708acaeb8bdbb3e6d7b59bc4c98537c26930837c475fe39de053e730be2463d82f1f3a9174b8dc
7
- data.tar.gz: 174a46f4fdffc88fae06522ec1f4e21191c667b874c92fe8ebe971f6550776b68d8980244fcb21406e57330fad363da96f7cd124e471e833e19ae182a52a93c1
6
+ metadata.gz: 7318e5f4c4337a04ebe0984549c1acc21a9601db4ece5f81d68d3d6abcb05d851a3febd30e3ea93ddb296e1ecd852fd63402b4be4ccb1e5bfde2a61df05cd7eb
7
+ data.tar.gz: 9674cd6581201e306b7d77dab530dc9c445260c71a7d7ed4fd14922c4c9c997bc007d087a2a5589c4313a21afe72473e4f20d52858f403be051f3b4a74cb4b03
@@ -1,3 +1,3 @@
1
1
  module ChefMetalVsphere
2
- VERSION = '0.3.31'
2
+ VERSION = '0.3.32'
3
3
  end
@@ -171,12 +171,42 @@ module ChefMetalVsphere
171
171
  raise 'either :host or :resource_pool must be specified when cloning from a VM Template' if pool.nil?
172
172
  end
173
173
 
174
- unless options[:datastore].to_s.empty?
175
- rspec.datastore = find_datastore(datacenter, options[:datastore])
174
+ if options.has_key?(:use_linked_template)
175
+ create_delta_disk(vm_template)
176
+ rspec.diskMoveType = :moveChildMostDiskBacking
177
+ else
178
+ unless options[:datastore].to_s.empty?
179
+ rspec.datastore = find_datastore(datacenter, options[:datastore])
180
+ end
176
181
  end
182
+
177
183
  rspec
178
184
  end
179
185
 
186
+ def create_delta_disk(vm_template)
187
+ disks = vm_template.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)
188
+ disks.select { |disk| disk.backing.parent == nil }.each do |disk|
189
+ spec = {
190
+ :deviceChange => [
191
+ {
192
+ :operation => :remove,
193
+ :device => disk
194
+ },
195
+ {
196
+ :operation => :add,
197
+ :fileOperation => :create,
198
+ :device => disk.dup.tap { |new_disk|
199
+ new_disk.backing = new_disk.backing.dup
200
+ new_disk.backing.fileName = "[#{disk.backing.datastore.name}]"
201
+ new_disk.backing.parent = disk.backing
202
+ },
203
+ }
204
+ ]
205
+ }
206
+ vm_template.ReconfigVM_Task(:spec => spec).wait_for_completion
207
+ end
208
+ end
209
+
180
210
  def virtual_disk_for(vm, options)
181
211
  if options[:datastore].to_s.empty?
182
212
  raise ":datastore must be specified when adding a disk to a cloned vm"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clc-chef-metal-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.31
4
+ version: 0.3.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - CenturyLink Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-22 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef