'Verify all the input parameters regardless of the provisioning
strategy being performed.'

def _validate_and_build_base_options(self, 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 instance_type['disabled']:
        raise exception.FlavorNotFound(flavor_id=instance_type['id'])
    if user_data:
        l = len(user_data)
        if (l > MAX_USERDATA_SIZE):
            raise exception.InstanceUserDataTooLarge(length=l, maxsize=MAX_USERDATA_SIZE)
        try:
            base64utils.decode_as_bytes(user_data)
        except (base64.binascii.Error, TypeError):
            raise exception.InstanceUserDataMalformed()
    security_groups = self._check_requested_secgroups(context, security_groups)
    max_network_count = self._check_requested_networks(context, requested_networks, max_count)
    (kernel_id, ramdisk_id) = self._handle_kernel_and_ramdisk(context, kernel_id, ramdisk_id, boot_meta)
    config_drive = self._check_config_drive(config_drive)
    if ((key_data is None) and (key_name is not None)):
        key_pair = objects.KeyPair.get_by_name(context, context.user_id, key_name)
        key_data = key_pair.public_key
    else:
        key_pair = None
    root_device_name = block_device.prepend_dev(block_device.properties_root_device_name(boot_meta.get('properties', {})))
    try:
        image_meta = objects.ImageMeta.from_dict(boot_meta)
    except ValueError as e:
        msg = (_('Invalid    image    metadata.    Error:    %s') % six.text_type(e))
        raise exception.InvalidRequest(msg)
    numa_topology = hardware.numa_get_constraints(instance_type, image_meta)
    system_metadata = {}
    pci_request_info = pci_request.get_pci_requests_from_flavor(instance_type)
    self.network_api.create_pci_requests_for_sriov_ports(context, pci_request_info, requested_networks)
    base_options = {'reservation_id': reservation_id, 'image_ref': image_href, 'kernel_id': (kernel_id or ''), 'ramdisk_id': (ramdisk_id or ''), 'power_state': power_state.NOSTATE, 'vm_state': vm_states.BUILDING, 'config_drive': config_drive, 'user_id': context.user_id, 'project_id': context.project_id, 'instance_type_id': instance_type['id'], 'memory_mb': instance_type['memory_mb'], 'vcpus': instance_type['vcpus'], 'root_gb': instance_type['root_gb'], 'ephemeral_gb': instance_type['ephemeral_gb'], 'display_name': display_name, 'display_description': display_description, 'user_data': user_data, 'key_name': key_name, 'key_data': key_data, 'locked': False, 'metadata': (metadata or {}), 'access_ip_v4': access_ip_v4, 'access_ip_v6': access_ip_v6, 'availability_zone': availability_zone, 'root_device_name': root_device_name, 'progress': 0, 'pci_requests': pci_request_info, 'numa_topology': numa_topology, 'system_metadata': system_metadata}
    options_from_image = self._inherit_properties_from_image(boot_meta, auto_disk_config)
    base_options.update(options_from_image)
    return (base_options, max_network_count, key_pair, security_groups)
