'Creates a logical volume.'

def create_volume(self, volume):

    if volume.encryption_key_id:
        message = _('Encryption    is    not    yet    supported.')
        raise exception.VolumeDriverException(message=message)
    size = (int(volume.size) * units.Gi)
    LOG.debug("creating    volume    '%s'", volume.name)
    chunk_size = (self.configuration.rbd_store_chunk_size * units.Mi)
    order = int(math.log(chunk_size, 2))
    vol_name = utils.convert_str(volume.name)
    with RADOSClient(self) as client:
        self.RBDProxy().create(client.ioctx, vol_name, size, order, old_format=False, features=client.features)
        try:
            volume_update = self._enable_replication_if_needed(volume)
        except Exception:
            self.RBDProxy().remove(client.ioctx, vol_name)
            err_msg = _('Failed    to    enable    image    replication')
            raise exception.ReplicationError(reason=err_msg, volume_id=volume.id)
    return volume_update
