(POOLER-70) Update migrate_vm_and_record_timing for VM Provider

Previously the Pool Manager would use vSphere objects directly.  This commit
- Modifies the migrate_vm_and_record_timing method to use VM and Pool names
  instead of VM and Pool objects.
This commit is contained in:
Glenn Sarti 2017-03-31 14:23:56 -07:00
parent cf15829f05
commit 3f6ead8134
2 changed files with 11 additions and 15 deletions

View file

@ -506,11 +506,11 @@ module Vmpooler
end
end
def migrate_vm_and_record_timing(vm_object, vm_name, pool, host, source_host_name, dest_host_name, provider)
def migrate_vm_and_record_timing(vm_name, pool_name, source_host_name, dest_host_name, provider)
start = Time.now
provider.migrate_vm_host(vm_object, host)
provider.migrate_vm_to_host(pool_name, vm_name, dest_host_name)
finish = '%.2f' % (Time.now - start)
$metrics.timing("migrate.#{pool}", finish)
$metrics.timing("migrate.#{pool_name}", finish)
$metrics.increment("migrate_from.#{source_host_name}")
$metrics.increment("migrate_to.#{dest_host_name}")
checkout_to_migration = '%.2f' % (Time.now - Time.parse($redis.hget("vmpooler__vm__#{vm_name}", 'checkout')))