mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
f pool_manager
This commit is contained in:
parent
7154b48e04
commit
c067f85006
1 changed files with 7 additions and 3 deletions
|
|
@ -19,8 +19,8 @@ module Vmpooler
|
||||||
$threads = {}
|
$threads = {}
|
||||||
|
|
||||||
# WARNING DEBUG
|
# WARNING DEBUG
|
||||||
$logger.log('d',"Flushing REDIS WARNING!!!")
|
#$logger.log('d',"Flushing REDIS WARNING!!!")
|
||||||
$redis.flushdb
|
#$redis.flushdb
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check the state of a VM
|
# Check the state of a VM
|
||||||
|
|
@ -60,7 +60,7 @@ module Vmpooler
|
||||||
# DONE
|
# DONE
|
||||||
def fail_pending_vm(vm, pool, timeout, exists=true)
|
def fail_pending_vm(vm, pool, timeout, exists=true)
|
||||||
clone_stamp = $redis.hget("vmpooler__vm__#{vm}", 'clone')
|
clone_stamp = $redis.hget("vmpooler__vm__#{vm}", 'clone')
|
||||||
return if ! clone_stamp
|
return true if ! clone_stamp
|
||||||
|
|
||||||
time_since_clone = (Time.now - Time.parse(clone_stamp)) / 60
|
time_since_clone = (Time.now - Time.parse(clone_stamp)) / 60
|
||||||
if time_since_clone > timeout
|
if time_since_clone > timeout
|
||||||
|
|
@ -71,8 +71,12 @@ module Vmpooler
|
||||||
remove_nonexistent_vm(vm, pool)
|
remove_nonexistent_vm(vm, pool)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
true
|
||||||
rescue => err
|
rescue => err
|
||||||
$logger.log('d', "Fail pending VM failed with an error: #{err}")
|
$logger.log('d', "Fail pending VM failed with an error: #{err}")
|
||||||
|
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
# DONE
|
# DONE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue