Start keeping track of how long hosts are running

This commit is contained in:
Scott Schneider 2013-12-12 10:04:49 -08:00
parent 52861f4682
commit d13a9fcf3a
2 changed files with 2 additions and 0 deletions

View file

@ -197,6 +197,7 @@ end
def destroy_vm vm, pool
Thread.new {
$redis.srem('vmware_host_pool__completed__'+pool, vm)
$redis.hdel('vmware_host_pool__active__'+pool, vm)
host = $vsphere[pool].find_vms(vm)[vm]

View file

@ -68,6 +68,7 @@ post '/vm/:template' do
unless (vm.nil?)
$redis.sadd('vmware_host_pool__running__'+params[:template], vm)
$redis.hset('vmware_host_pool__active__'+params[:template], vm, Time.now)
result[params[:template]]['ok'] = true
result[params[:template]]['hostname'] = vm