'Create a volume.'

def create_volume(self, volume):

    model_update = {}
    volume_name = volume.get('id')
    volume_size = volume.get('size')
    LOG.debug('Creating    volume    %(name)s    of    size    %(size)s', {'name': volume_name, 'size': volume_size})
    scvolume = None
    with self._client.open_connection() as api:
        try:
            specs = self._get_volume_extra_specs(volume)
            scvolume = api.create_volume(volume_name, volume_size, specs.get('storagetype:storageprofile'), specs.get('storagetype:replayprofiles'), specs.get('storagetype:volumeqos'), specs.get('storagetype:groupqos'), specs.get('storagetype:datareductionprofile'))
            if (scvolume is None):
                raise exception.VolumeBackendAPIException(message=(_('Unable    to    create    volume    %s') % volume_name))
            self._add_volume_to_group(api, scvolume, volume)
            model_update = self._create_replications(api, volume, scvolume)
            model_update['provider_id'] = scvolume['instanceId']
        except Exception:
            self._cleanup_failed_create_volume(api, volume_name)
            with excutils.save_and_reraise_exception():
                LOG.error('Failed    to    create    volume    %s', volume_name)
    if (scvolume is None):
        raise exception.VolumeBackendAPIException(data=_('Unable    to    create    volume.    Backend    down.'))
    return model_update
