'Creates a volume.
:param volume: volume reference'

def create_volume(self, volume):

    LOG.debug('create_volume    on    %s', volume['host'])
    self._ensure_shares_mounted()
    pool_name = volume_utils.extract_host(volume['host'], level='pool')
    if (pool_name is None):
        msg = _('Pool    is    not    available    in    the    volume    host    field.')
        raise exception.InvalidHost(reason=msg)
    extra_specs = na_utils.get_volume_extra_specs(volume)
    try:
        volume['provider_location'] = pool_name
        LOG.debug('Using    pool    %s.', pool_name)
        self._do_create_volume(volume)
        self._do_qos_for_volume(volume, extra_specs)
        model_update = (self._get_volume_model_update(volume) or {})
        model_update['provider_location'] = volume['provider_location']
        return model_update
    except Exception:
        LOG.exception('Exception    creating    vol    %(name)s    on    pool    %(pool)s.', {'name': volume['name'], 'pool': volume['provider_location']})
        volume['provider_location'] = None
    msg = _('Volume    %(vol)s    could    not    be    created    in    pool    %(pool)s.')
    raise exception.VolumeBackendAPIException(data=(msg % {'vol': volume['name'], 'pool': pool_name}))
