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 +4 -4
- data/lib/chef_metal_vsphere/version.rb +1 -1
- data/lib/chef_metal_vsphere/vsphere_helpers.rb +32 -2
- 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: dd00184db58d16015203e91e92cd82447b24aa63
|
4
|
+
data.tar.gz: bbee8ee23bad1d04376dec8cc403db3dee9de282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7318e5f4c4337a04ebe0984549c1acc21a9601db4ece5f81d68d3d6abcb05d851a3febd30e3ea93ddb296e1ecd852fd63402b4be4ccb1e5bfde2a61df05cd7eb
|
7
|
+
data.tar.gz: 9674cd6581201e306b7d77dab530dc9c445260c71a7d7ed4fd14922c4c9c997bc007d087a2a5589c4313a21afe72473e4f20d52858f403be051f3b4a74cb4b03
|
@@ -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
|
-
|
175
|
-
|
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.
|
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-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|