'Verify all the input parameters regardless of the provisioning
strategy being performed and schedule the instance(s) for
creation.'

def _create_instance(self, context, instance_type, image_href, kernel_id, ramdisk_id, min_count, max_count, display_name, display_description, key_name, key_data, security_groups, availability_zone, user_data, metadata, injected_files, admin_password, access_ip_v4, access_ip_v6, requested_networks, config_drive, block_device_mapping, auto_disk_config, filter_properties, reservation_id=None, legacy_bdm=True, shutdown_terminate=False, check_server_group_quota=False, tags=None):

    if (reservation_id is None):
        reservation_id = utils.generate_uid('r')
    security_groups = (security_groups or ['default'])
    min_count = (min_count or 1)
    max_count = (max_count or min_count)
    block_device_mapping = (block_device_mapping or [])
    tags = (tags or [])
    if image_href:
        (image_id, boot_meta) = self._get_image(context, image_href)
    else:
        image_id = None
        boot_meta = self._get_bdm_image_metadata(context, block_device_mapping, legacy_bdm)
    self._check_auto_disk_config(image=boot_meta, auto_disk_config=auto_disk_config)
    (base_options, max_net_count, key_pair, security_groups) = self._validate_and_build_base_options(context, instance_type, boot_meta, image_href, image_id, kernel_id, ramdisk_id, display_name, display_description, key_name, key_data, security_groups, availability_zone, user_data, metadata, access_ip_v4, access_ip_v6, requested_networks, config_drive, auto_disk_config, reservation_id, max_count)
    if (max_net_count < min_count):
        raise exception.PortLimitExceeded()
    elif (max_net_count < max_count):
        LOG.info('max    count    reduced    from    %(max_count)d    to    %(max_net_count)d    due    to    network    port    quota', {'max_count': max_count, 'max_net_count': max_net_count})
        max_count = max_net_count
    block_device_mapping = self._check_and_transform_bdm(context, base_options, instance_type, boot_meta, min_count, max_count, block_device_mapping, legacy_bdm)
    self._checks_for_create_and_rebuild(context, image_id, boot_meta, instance_type, metadata, injected_files, block_device_mapping.root_bdm())
    instance_group = self._get_requested_instance_group(context, filter_properties)
    tags = self._create_tag_list_obj(context, tags)
    instances_to_build = self._provision_instances(context, instance_type, min_count, max_count, base_options, boot_meta, security_groups, block_device_mapping, shutdown_terminate, instance_group, check_server_group_quota, filter_properties, key_pair, tags)
    instances = []
    request_specs = []
    build_requests = []
    for (rs, build_request, im) in instances_to_build:
        build_requests.append(build_request)
        instance = build_request.get_new_instance(context)
        instances.append(instance)
        request_specs.append(rs)
    if CONF.cells.enable:
        for instance in instances:
            instance.create()
        if CONF.quota.recheck_quota:
            try:
                compute_utils.check_num_instances_quota(context, instance_type, 0, 0, orig_num_req=len(instances))
            except exception.TooManyInstances:
                with excutils.save_and_reraise_exception():
                    self._cleanup_build_artifacts(instances, instances_to_build)
        self.compute_task_api.build_instances(context, instances=instances, image=boot_meta, filter_properties=filter_properties, admin_password=admin_password, injected_files=injected_files, requested_networks=requested_networks, security_groups=security_groups, block_device_mapping=block_device_mapping, legacy_bdm=False)
    else:
        self.compute_task_api.schedule_and_build_instances(context, build_requests=build_requests, request_spec=request_specs, image=boot_meta, admin_password=admin_password, injected_files=injected_files, requested_networks=requested_networks, block_device_mapping=block_device_mapping, tags=tags)
    return (instances, reservation_id)
