Record clone times in Redis, add a '/status' API endpoint

This commit is contained in:
Scott Schneider 2015-01-27 12:44:46 -08:00
parent 11016fecdc
commit ecd17606f6
2 changed files with 43 additions and 0 deletions

View file

@ -230,6 +230,8 @@ module Vmpooler
).wait_for_completion
finish = '%.2f' % (Time.now-start)
$redis.hset('vmpooler__vm__'+vm['hostname'], 'clone_time', finish)
$logger.log('s', "[+] [#{vm['template']}] '#{vm['hostname']}' cloned from '#{vm['template']}' in #{finish} seconds")
rescue
$logger.log('s', "[!] [#{vm['template']}] '#{vm['hostname']}' clone appears to have failed")