"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/backup/drivers/ceph.py" between
cinder-15.5.0.tar.gz and cinder-15.6.0.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Train" series (maintained release).

ceph.py  (cinder-15.5.0):ceph.py  (cinder-15.6.0)
skipping to change at line 245 skipping to change at line 245
@property @property
def _supports_exclusive_lock(self): def _supports_exclusive_lock(self):
"""Determine if exclusive-lock is supported by librbd.""" """Determine if exclusive-lock is supported by librbd."""
return hasattr(self.rbd, 'RBD_FEATURE_EXCLUSIVE_LOCK') return hasattr(self.rbd, 'RBD_FEATURE_EXCLUSIVE_LOCK')
@property @property
def _supports_journaling(self): def _supports_journaling(self):
"""Determine if journaling is supported by our version of librbd.""" """Determine if journaling is supported by our version of librbd."""
return hasattr(self.rbd, 'RBD_FEATURE_JOURNALING') return hasattr(self.rbd, 'RBD_FEATURE_JOURNALING')
@property
def _supports_fast_diff(self):
"""Determine if fast-diff is supported by our version of librbd."""
return hasattr(self.rbd, 'RBD_FEATURE_FAST_DIFF')
def _get_rbd_support(self): def _get_rbd_support(self):
"""Determine RBD features supported by our version of librbd.""" """Determine RBD features supported by our version of librbd."""
old_format = True old_format = True
features = 0 features = 0
if self._supports_layering: if self._supports_layering:
old_format = False old_format = False
features |= self.rbd.RBD_FEATURE_LAYERING features |= self.rbd.RBD_FEATURE_LAYERING
if self._supports_stripingv2: if self._supports_stripingv2:
old_format = False old_format = False
features |= self.rbd.RBD_FEATURE_STRIPINGV2 features |= self.rbd.RBD_FEATURE_STRIPINGV2
# journaling requires exclusive_lock; check both together
if CONF.backup_ceph_image_journals: if CONF.backup_ceph_image_journals:
if self._supports_exclusive_lock and self._supports_journaling: LOG.debug("RBD journaling supported by backend and requested "
old_format = False "via config. Enabling it together with "
features |= (self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK | "exclusive-lock")
self.rbd.RBD_FEATURE_JOURNALING) old_format = False
else: features |= (self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK |
# FIXME (tasker): when the backup manager supports loading the self.rbd.RBD_FEATURE_JOURNALING)
# driver during its initialization, this exception should be
# moved to the driver's initialization so that it can stop # NOTE(christian_rohmann): Check for fast-diff support and enable it
# the service from starting when the underyling RBD does not if self._supports_fast_diff:
# support the requested features. LOG.debug("RBD also supports fast-diff, enabling it "
LOG.error("RBD journaling not supported - unable to " "together with exclusive-lock and object-map")
"support per image mirroring in backup pool") old_format = False
raise exception.BackupInvalidCephArgs( features |= (self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK |
_("Image Journaling set but RBD backend does " self.rbd.RBD_FEATURE_OBJECT_MAP |
"not support journaling") self.rbd.RBD_FEATURE_FAST_DIFF)
)
return (old_format, features) return (old_format, features)
def check_for_setup_error(self): def check_for_setup_error(self):
"""Returns an error if prerequisites aren't met.""" """Returns an error if prerequisites aren't met."""
if rados is None or rbd is None: if rados is None or rbd is None:
msg = _('rados and rbd python libraries not found') msg = _('rados and rbd python libraries not found')
raise exception.BackupDriverException(reason=msg) raise exception.BackupDriverException(reason=msg)
for attr in ['backup_ceph_user', 'backup_ceph_pool', for attr in ['backup_ceph_user', 'backup_ceph_pool',
skipping to change at line 295 skipping to change at line 298
val = getattr(CONF, attr) val = getattr(CONF, attr)
if not val: if not val:
raise exception.InvalidConfigurationValue(option=attr, raise exception.InvalidConfigurationValue(option=attr,
value=val) value=val)
# NOTE: Checking connection to ceph # NOTE: Checking connection to ceph
# RADOSClient __init__ method invokes _connect_to_rados # RADOSClient __init__ method invokes _connect_to_rados
# so no need to check for self.rados.Error here. # so no need to check for self.rados.Error here.
with rbd_driver.RADOSClient(self, self._ceph_backup_pool): with rbd_driver.RADOSClient(self, self._ceph_backup_pool):
pass pass
# NOTE(christian_rohmann): Check features required for journaling
if CONF.backup_ceph_image_journals:
if not self._supports_exclusive_lock and self._supports_journaling:
LOG.error("RBD journaling not supported - unable to "
"support per image mirroring in backup pool")
raise exception.BackupInvalidCephArgs(
_("Image Journaling set but RBD backend does "
"not support journaling")
)
def _connect_to_rados(self, pool=None): def _connect_to_rados(self, pool=None):
"""Establish connection to the backup Ceph cluster.""" """Establish connection to the backup Ceph cluster."""
client = eventlet.tpool.Proxy(self.rados.Rados( client = eventlet.tpool.Proxy(self.rados.Rados(
rados_id=self._ceph_backup_user, rados_id=self._ceph_backup_user,
conffile=self._ceph_backup_conf)) conffile=self._ceph_backup_conf))
try: try:
client.connect() client.connect()
pool_to_open = utils.convert_str(pool or self._ceph_backup_pool) pool_to_open = utils.convert_str(pool or self._ceph_backup_pool)
ioctx = client.open_ioctx(pool_to_open) ioctx = client.open_ioctx(pool_to_open)
return client, ioctx return client, ioctx
 End of changes. 4 change blocks. 
17 lines changed or deleted 30 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)