'Create a volume.
:param volume_name: the volume name
:param volume_size: the volume size
:param extra_specs: extra specifications
:returns: int -- return code
:returns: dict -- volume_dict
:raises: VolumeBackendAPIException:'

def _create_volume(self, volume_name, volume_size, extra_specs):

    array = extra_specs[utils.ARRAY]
    (is_valid_slo, is_valid_workload) = self.provision.verify_slo_workload(array, extra_specs[utils.SLO], extra_specs[utils.WORKLOAD], extra_specs[utils.SRP])
    if ((not is_valid_slo) or (not is_valid_workload)):
        exception_message = (_('Either    SLO:    %(slo)s    or    workload    %(workload)s    is    invalid.    Examine    previous    error    statement    for    valid    values.') % {'slo': extra_specs[utils.SLO], 'workload': extra_specs[utils.WORKLOAD]})
        LOG.error(exception_message)
        raise exception.VolumeBackendAPIException(data=exception_message)
    LOG.debug('Create    Volume:    %(volume)s        Srp:    %(srp)s    Array:    %(array)s    Size:    %(size)lu.', {'volume': volume_name, 'srp': extra_specs[utils.SRP], 'array': array, 'size': volume_size})
    do_disable_compression = self.utils.is_compression_disabled(extra_specs)
    storagegroup_name = self.masking.get_or_create_default_storage_group(array, extra_specs[utils.SRP], extra_specs[utils.SLO], extra_specs[utils.WORKLOAD], extra_specs, do_disable_compression)
    try:
        volume_dict = self.provision.create_volume_from_sg(array, volume_name, storagegroup_name, volume_size, extra_specs)
    except Exception:
        LOG.error('Create    volume    failed.    Checking    if    storage    group    cleanup    necessary...')
        num_vol_in_sg = self.rest.get_num_vols_in_sg(array, storagegroup_name)
        if (num_vol_in_sg == 0):
            LOG.debug('There    are    no    volumes    in    the    storage    group    %(sg_id)s.    Deleting    storage    group.', {'sg_id': storagegroup_name})
            self.rest.delete_storage_group(array, storagegroup_name)
        raise
    return volume_dict
