def migrate(name, target=''):
    '''
    Migrate a VM from one host to another. This routine will just start
    the migration and display information on how to look up the progress.
    '''
    client = salt.client.get_local_client(__opts__['conf_file'])
    data = query(quiet=True)
    origin_data = _find_vm(name, data, quiet=True)
    try:
        origin_host = list(origin_data.keys())[0]
    except IndexError:
        __jid_event__.fire_event({'error': 'Named VM {0} was not found to migrate'.format(name)}, 'progress')
        return ''
    disks = origin_data[origin_host][name]['disks']
    if not origin_data:
        __jid_event__.fire_event({'error': 'Named VM {0} was not found to migrate'.format(name)}, 'progress')
        return ''
    if not target:
        target = _determine_host(data, origin_host)
    if target not in data:
        __jid_event__.fire_event({'error': 'Target host {0} not found'.format(origin_data)}, 'progress')
        return ''
    try:
        client.cmd(target, 'virt.seed_non_shared_migrate', [disks, True])
        jid = client.cmd_async(origin_host,
                               'virt.migrate_non_shared',
                               [name, target])
    except SaltClientError as client_error:
        return 'Virtual machine {0} could not be migrated: {1}'.format(name, client_error)

    msg = ('The migration of virtual machine {0} to host {1} has begun, '
           'and can be tracked via jid {2}. The ``salt-run virt.query`` '
           'runner can also be used, the target VM will be shown as paused '
           'until the migration is complete.').format(name, target, jid)
    __jid_event__.fire_event({'message': msg}, 'progress')
Migrate a VM from one host to another. This routine will just start
    the migration and display information on how to look up the progress.