(POOLER-70) Update check_running_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
This commit is contained in:
Glenn Sarti 2017-03-31 13:51:36 -07:00
parent 8c421aa3bd
commit cc1910fd76
2 changed files with 16 additions and 12 deletions

View file

@ -149,12 +149,17 @@ module Vmpooler
def check_running_vm(vm, pool, ttl, provider)
Thread.new do
_check_running_vm(vm, pool, ttl, provider)
begin
_check_running_vm(vm, pool, ttl, provider)
rescue => err
$logger.log('s', "[!] [#{pool}] '#{vm}' failed while checking VM with an error: #{err}")
raise
end
end
end
def _check_running_vm(vm, pool, ttl, provider)
host = provider.find_vm(vm)
host = provider.get_vm(pool, vm)
if host
queue_from, queue_to = 'running', 'completed'