'Running evacuate to target host.
Checking vm compute host state, if the host not in expected_state,
raising an exception.
:param instance: The instance to evacuate
:param host: Target host. if not set, the scheduler will pick up one
:param on_shared_storage: True if instance files on shared storage
:param admin_password: password to set on rebuilt instance
:param force: Force the evacuation to the specific host target'

@check_instance_state(vm_state=[vm_states.ACTIVE, vm_states.STOPPED, vm_states.ERROR])
def evacuate(self, context, instance, host, on_shared_storage, admin_password=None, force=None):

    LOG.debug('vm    evacuation    scheduled', instance=instance)
    inst_host = instance.host
    service = objects.Service.get_by_compute_host(context, inst_host)
    if self.servicegroup_api.service_is_up(service):
        LOG.error('Instance    compute    service    state    on    %s    expected    to    be    down,    but    it    was    up.', inst_host)
        raise exception.ComputeServiceInUse(host=inst_host)
    instance.task_state = task_states.REBUILDING
    instance.save(expected_task_state=[None])
    self._record_action_start(context, instance, instance_actions.EVACUATE)
    migration = objects.Migration(context, source_compute=instance.host, source_node=instance.node, instance_uuid=instance.uuid, status='accepted', migration_type='evacuation')
    if host:
        migration.dest_compute = host
    migration.create()
    compute_utils.notify_about_instance_usage(self.notifier, context, instance, 'evacuate')
    try:
        request_spec = objects.RequestSpec.get_by_instance_uuid(context, instance.uuid)
    except exception.RequestSpecNotFound:
        request_spec = None
    if ((force is False) and host):
        nodes = objects.ComputeNodeList.get_all_by_host(context, host)
        host = None
        target = nodes[0]
        if request_spec:
            destination = objects.Destination(host=target.host, node=target.hypervisor_hostname)
            request_spec.requested_destination = destination
    return self.compute_task_api.rebuild_instance(context, instance=instance, new_pass=admin_password, injected_files=None, image_ref=None, orig_image_ref=None, orig_sys_metadata=None, bdms=None, recreate=True, on_shared_storage=on_shared_storage, host=host, request_spec=request_spec)
