(POOLER-70) Add get_pool_name_for_vm for VM Provider

Previously there was no simple way to calculate which pool a VM was a member of.
This commit adds a helper method which queries redis for the pool name for a
given VM.
This commit is contained in:
Glenn Sarti 2017-03-31 14:07:08 -07:00
parent c7b37dec75
commit c09035cfcb
2 changed files with 23 additions and 0 deletions

View file

@ -348,6 +348,11 @@ module Vmpooler
result
end
def get_pool_name_for_vm(vm_name)
# the 'template' is a bad name. Should really be 'poolname'
$redis.hget('vmpooler__vm__' + vm_name, 'template')
end
def check_disk_queue(maxloop = 0, loop_delay = 5)
$logger.log('d', "[*] [disk_manager] starting worker thread")