mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
Make it possible to disable linked clones
This commit adds a new configuration parameter to allow setting whether to create linked clones on a global, or per pool basis. Without this change vmpooler would always attempt to create linked clones. The default behavior of creating linked clones is preserved.
This commit is contained in:
parent
d319643123
commit
09a382a10f
7 changed files with 58 additions and 2 deletions
|
|
@ -312,7 +312,7 @@ module Vmpooler
|
|||
# Put the VM in the specified folder and resource pool
|
||||
relocate_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(
|
||||
datastore: find_datastore(target_datastore, connection, target_datacenter_name),
|
||||
diskMoveType: :moveChildMostDiskBacking
|
||||
diskMoveType: get_disk_backing(pool)
|
||||
)
|
||||
|
||||
manage_host_selection = @config[:config]['manage_host_selection'] if @config[:config].key?('manage_host_selection')
|
||||
|
|
@ -1028,6 +1028,17 @@ module Vmpooler
|
|||
return false if template[-1] == '/'
|
||||
return true
|
||||
end
|
||||
|
||||
def get_disk_backing(pool)
|
||||
return :moveChildMostDiskBacking if linked_clone?(pool)
|
||||
return :moveAllDiskBackingsAndConsolidate
|
||||
end
|
||||
|
||||
def linked_clone?(pool)
|
||||
return if pool[:create_linked_clone] == false
|
||||
return true if pool[:create_linked_clone]
|
||||
return true if @config[:config]['create_linked_clones']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue