'Creates volume with given label and size.'

def _create_volume(self, eseries_pool_label, eseries_volume_label, size_gb, extra_specs=None):

    if (extra_specs is None):
        extra_specs = {}
    if self.configuration.netapp_enable_multiattach:
        volumes = self._client.list_volumes()
        if (len(volumes) > utils.MAX_LUNS_PER_HOST_GROUP):
            msg = (_("Cannot    create    more    than    %(req)s    volumes    on    the    ESeries    array    when    'netapp_enable_multiattach'    is    set    to    true.") % {'req': utils.MAX_LUNS_PER_HOST_GROUP})
            raise exception.NetAppDriverException(msg)
    read_cache = extra_specs.get(self.READ_CACHE_Q_SPEC)
    if (read_cache is not None):
        read_cache = na_utils.to_bool(read_cache)
    write_cache = extra_specs.get(self.WRITE_CACHE_Q_SPEC)
    if (write_cache is not None):
        write_cache = na_utils.to_bool(write_cache)
    flash_cache = extra_specs.get(self.FLASH_CACHE_UQ_SPEC)
    if (flash_cache is not None):
        flash_cache = na_utils.to_bool(flash_cache)
    data_assurance = extra_specs.get(self.DA_UQ_SPEC)
    if (data_assurance is not None):
        data_assurance = na_utils.to_bool(data_assurance)
    thin_provision = extra_specs.get(self.THIN_UQ_SPEC)
    if (thin_provision is not None):
        thin_provision = na_utils.to_bool(thin_provision)
    target_pool = None
    pools = self._get_storage_pools()
    for pool in pools:
        if (pool['label'] == eseries_pool_label):
            target_pool = pool
            break
    if (not target_pool):
        msg = _('Pools    %s    does    not    exist')
        raise exception.NetAppDriverException((msg % eseries_pool_label))
    try:
        vol = self._client.create_volume(target_pool['volumeGroupRef'], eseries_volume_label, size_gb, read_cache=read_cache, write_cache=write_cache, flash_cache=flash_cache, data_assurance=data_assurance, thin_provision=thin_provision)
        LOG.info('Created    volume    with    label    %s.', eseries_volume_label)
    except exception.NetAppDriverException as e:
        with excutils.save_and_reraise_exception():
            LOG.error('Error    creating    volume.    Msg    -    %s.', e)
            try:
                bad_vol = self._get_volume(eseries_volume_label)
            except Exception:
                pass
            else:
                try:
                    self._client.delete_volume(bad_vol['id'])
                except exception.NetAppDriverException as e2:
                    LOG.error('Error    cleaning    up    failed    volume    creation.        Msg    -    %s.', e2)
    return vol
