mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
(POOLER-191) Add checking for running instances that are not in active
This change adds detection of running instances that are in a running queue, but have no data in a active queue for the same pool. When this happens a machine will live forever, impacting the running count, and preventing the machine from being killed. Without this change running instances that are not marked as active will live forever.
This commit is contained in:
parent
35104a75bb
commit
0ad069b958
2 changed files with 17 additions and 13 deletions
|
|
@ -289,19 +289,15 @@ module Vmpooler
|
|||
move_vm_queue(pool, vm, 'running', 'completed', redis, "reached end of TTL after #{ttl} hours")
|
||||
throw :stop_checking
|
||||
end
|
||||
end
|
||||
|
||||
if provider.vm_ready?(pool, vm)
|
||||
throw :stop_checking
|
||||
else
|
||||
host = provider.get_vm(pool, vm)
|
||||
|
||||
if host
|
||||
throw :stop_checking
|
||||
else
|
||||
move_vm_queue(pool, vm, 'running', 'completed', redis, 'is no longer in inventory, removing from running')
|
||||
end
|
||||
move_vm_queue(pool, vm, 'running', 'completed', redis, 'is listed as running, but has no checkouttime data. Removing from running')
|
||||
end
|
||||
|
||||
throw :stop_checking if provider.vm_ready?(pool, vm)
|
||||
|
||||
throw :stop_checking if provider.get_vm(pool, vm)
|
||||
|
||||
move_vm_queue(pool, vm, 'running', 'completed', redis, 'is no longer in inventory, removing from running')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue