mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(POOLER-70) Update fail_pending_vm for VM Provider
Previously the Pool Manager would use vSphere objects directly. This commit - Modifies the pool_manager to use the VM provider methods instead - Modified to return true or false to indicate that the VM was failed
This commit is contained in:
parent
199bf4a070
commit
9f4fc903b9
2 changed files with 10 additions and 8 deletions
|
|
@ -50,9 +50,9 @@ module Vmpooler
|
|||
$logger.log('d', "[!] [#{pool}] '#{vm}' no longer exists. Removing from pending.")
|
||||
end
|
||||
|
||||
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')
|
||||
return if ! clone_stamp
|
||||
return true if !clone_stamp
|
||||
|
||||
time_since_clone = (Time.now - Time.parse(clone_stamp)) / 60
|
||||
if time_since_clone > timeout
|
||||
|
|
@ -63,8 +63,10 @@ module Vmpooler
|
|||
remove_nonexistent_vm(vm, pool)
|
||||
end
|
||||
end
|
||||
true
|
||||
rescue => err
|
||||
$logger.log('d', "Fail pending VM failed with an error: #{err}")
|
||||
false
|
||||
end
|
||||
|
||||
def move_pending_vm_to_ready(vm, pool, host)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue