Merge "Add log for snapshot an instance"

This commit is contained in:
Zuul
2018-02-10 04:52:15 +00:00
committed by Gerrit Code Review
+5 -2
View File
@@ -3330,8 +3330,11 @@ class ComputeManager(manager.Manager):
instance.task_state = task_state
instance.save(expected_task_state=expected_state)
self.driver.snapshot(context, instance, image_id,
update_task_state)
with timeutils.StopWatch() as timer:
self.driver.snapshot(context, instance, image_id,
update_task_state)
LOG.info('Took %0.2f seconds to snapshot the instance on '
'the hypervisor.', timer.elapsed(), instance=instance)
instance.task_state = None
instance.save(expected_task_state=task_states.IMAGE_UPLOADING)