'Migrate a server lively to a new host.'

@check_instance_lock
@check_instance_cell
@check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.PAUSED])
def live_migrate(self, context, instance, block_migration, disk_over_commit, host_name, force=None, async=False):

    LOG.debug('Going    to    try    to    live    migrate    instance    to    %s', (host_name or 'another    host'), instance=instance)
    instance.task_state = task_states.MIGRATING
    instance.save(expected_task_state=[None])
    self._record_action_start(context, instance, instance_actions.LIVE_MIGRATION)
    self.consoleauth_rpcapi.delete_tokens_for_instance(context, instance.uuid)
    try:
        request_spec = objects.RequestSpec.get_by_instance_uuid(context, instance.uuid)
    except exception.RequestSpecNotFound:
        request_spec = None
    if ((force is False) and host_name):
        nodes = objects.ComputeNodeList.get_all_by_host(context, host_name)
        host_name = None
        target = nodes[0]
        if request_spec:
            destination = objects.Destination(host=target.host, node=target.hypervisor_hostname)
            request_spec.requested_destination = destination
    try:
        self.compute_task_api.live_migrate_instance(context, instance, host_name, block_migration=block_migration, disk_over_commit=disk_over_commit, request_spec=request_spec, async=async)
    except oslo_exceptions.MessagingTimeout as messaging_timeout:
        with excutils.save_and_reraise_exception():
            compute_utils.add_instance_fault_from_exc(context, instance, messaging_timeout)
