mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
'vm_checktime' sets interval for check_ready_vm
This commit is contained in:
parent
1e6ca05d14
commit
62cbc5a6ff
1 changed files with 32 additions and 22 deletions
|
|
@ -33,6 +33,7 @@ end
|
||||||
|
|
||||||
# Set some defaults
|
# Set some defaults
|
||||||
$config[:config]['task_limit'] ||= 10
|
$config[:config]['task_limit'] ||= 10
|
||||||
|
$config[:config]['vm_checktime'] ||= 15
|
||||||
$config[:config]['vm_lifetime'] ||= 24
|
$config[:config]['vm_lifetime'] ||= 24
|
||||||
$config[:redis] ||= Hash.new
|
$config[:redis] ||= Hash.new
|
||||||
$config[:redis]['server'] ||= 'localhost'
|
$config[:redis]['server'] ||= 'localhost'
|
||||||
|
|
@ -96,6 +97,14 @@ def check_ready_vm vm, pool, ttl
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
check_stamp = $redis.hget('vmware_host_pool__vm__'+vm, 'check')
|
||||||
|
|
||||||
|
if (
|
||||||
|
(! check_stamp) or
|
||||||
|
((Time.now - Time.parse(clone_stamp)) > $config[:config]['vm_checktime'])
|
||||||
|
)
|
||||||
|
$redis.hset('vmware_host_pool__vm__'+vm, 'check', Time.now)
|
||||||
|
|
||||||
if (host)
|
if (host)
|
||||||
if (
|
if (
|
||||||
(host.runtime) and
|
(host.runtime) and
|
||||||
|
|
@ -121,6 +130,7 @@ def check_ready_vm vm, pool, ttl
|
||||||
$logger.log('d', "[!] [#{pool}] '#{vm}' is unreachable, removed from 'ready' queue")
|
$logger.log('d', "[!] [#{pool}] '#{vm}' is unreachable, removed from 'ready' queue")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue