Request an instance to be built

def request_instance(vm_, conn=None, call=None):
    '''
    Request an instance to be built
    '''
    if call == 'function':
        # Technically this function may be called other ways too, but it
        # definitely cannot be called with --function.
        raise SaltCloudSystemExit(
            'The request_instance action must be called with -a or --action.'
        )
    kwargs = copy.deepcopy(vm_)
    log.info('Creating Cloud VM %s', vm_['name'])
    __utils__['cloud.check_name'](vm_['name'], 'a-zA-Z0-9._-')
    conn = get_conn()
    userdata = config.get_cloud_config_value(
        'userdata', vm_, __opts__, search_global=False, default=None
    )
    if userdata is not None and os.path.isfile(userdata):
        try:
            with __utils__['files.fopen'](userdata, 'r') as fp_:
                kwargs['userdata'] = __utils__['cloud.userdata_template'](
                    __opts__, vm_, fp_.read()
                )
        except Exception as exc:
            log.exception(
                'Failed to read userdata from %s: %s', userdata, exc)
    if 'size' in kwargs:
        kwargs['flavor'] = kwargs.pop('size')
    kwargs['key_name'] = config.get_cloud_config_value(
        'ssh_key_name', vm_, __opts__, search_global=False, default=None
    )
    kwargs['wait'] = True
    try:
        conn.create_server(**_clean_create_kwargs(**kwargs))
    except shade.exc.OpenStackCloudException as exc:
        log.error('Error creating server %s: %s', vm_['name'], exc)
        destroy(vm_['name'], conn=conn, call='action')
        raise SaltCloudSystemExit(six.text_type(exc))

    return show_instance(vm_['name'], conn=conn, call='action')