mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 10:28:41 -05:00
Allow a 'clone_target' configuration setting
If set, this setting will enable "fake DRS", cloning VMs onto the host in the specified cluster containing the least amount of VMs.
This commit is contained in:
parent
1d6f3037f8
commit
e8125e7702
3 changed files with 34 additions and 0 deletions
|
|
@ -195,9 +195,15 @@ module Vmpooler
|
|||
})
|
||||
)
|
||||
|
||||
# Choose a clone target
|
||||
if ($config[:config]['clone_target']
|
||||
$clone_target = $vsphere[vm['template']].find_least_used_host($config[:config]['clone_target'])
|
||||
end
|
||||
|
||||
# Put the VM in the specified folder and resource pool
|
||||
relocateSpec = RbVmomi::VIM.VirtualMachineRelocateSpec(
|
||||
:datastore => $vsphere[vm['template']].find_datastore(datastore),
|
||||
:host => $clone_target,
|
||||
:diskMoveType => :moveChildMostDiskBacking
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue