B #2274: it is possible to remove disk from vCenter templates (#2383)

This commit is contained in:
Sergio Semedi Barranco authored and Tino Vázquez committed 2018-09-05 16:58:38 +02:00
1 parent 052a06d5f7
commit ca5b1f7210
1 file changed
+3 -5
@@ -1247,11 +1247,9 @@ class VirtualMachine < VCenterDriver::Template
persistent = VCenterDriver::VIHelper.find_persistent_image_by_source(source, ipool)
if !persistent
detach_disk_array << {
:fileOperation => :destroy,
:operation => :remove,
:device => d[:device]
}
op = {operation: :remove, device: d[:device]}
op[:fileOperation] = :destroy unless d[:type] == "CDROM"
detach_disk_array << op
end
# Remove reference opennebula.disk if exist