'Resume the given suspended instance.'

@wrap_exception()
@reverts_task_state
@wrap_instance_event(prefix='compute')
@wrap_instance_fault
def resume_instance(self, context, instance):

    context = context.elevated()
    LOG.info('Resuming', instance=instance)
    self._notify_about_instance_usage(context, instance, 'resume.start')
    compute_utils.notify_about_instance_action(context, instance, self.host, action=fields.NotificationAction.RESUME, phase=fields.NotificationPhase.START)
    network_info = self.network_api.get_instance_nw_info(context, instance)
    block_device_info = self._get_instance_block_device_info(context, instance)
    with self._error_out_instance_on_exception(context, instance, instance_state=instance.vm_state):
        self.driver.resume(context, instance, network_info, block_device_info)
    instance.power_state = self._get_power_state(context, instance)
    instance.vm_state = instance.system_metadata.pop('old_vm_state', vm_states.ACTIVE)
    instance.task_state = None
    instance.save(expected_task_state=task_states.RESUMING)
    self._notify_about_instance_usage(context, instance, 'resume.end')
    compute_utils.notify_about_instance_action(context, instance, self.host, action=fields.NotificationAction.RESUME, phase=fields.NotificationPhase.END)
