summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGorka Eguileor <geguileo@redhat.com>2022-07-08 14:08:09 +0200
committerGorka Eguileor <geguileo@redhat.com>2022-07-12 11:30:31 +0200
commit73ebb705425047f781dccc13508ba82bb1434db7 (patch)
tree7e7c1d7113c3928fd31ca7230d8f9984c5e3212b
parent5ff06df97fbd78f6781793c35801a4c989a515f1 (diff)
downloadglance_store-73ebb705425047f781dccc13508ba82bb1434db7.tar.gz
Support os-brick specific lock_path for Cinder4.0.1
As a new feature relevant for the Cinder store, os-brick now supports setting the location of file locks in a different location from the locks of the service. The functionality is intended for HCI deployments and hosts that are running Cinder and Glance using Cinder backend. In those scenarios the service can use a service specific location for its file locks while only sharing the location of os-brick with the other services. To leverage this functionality the new os-brick code is needed and method ``os_brick.setup`` needs to be called once the service configuration options have been loaded. The default value of the os-brick ``lock_path`` is the one set in ``oslo_concurrency``. This patch adds support for this new feature in a backward compatible way so code works even if using an os-brick version that doesn't have this feature. That is the case for many CI jobs that install os-brick from PyPi instead of the code present in master. Change-Id: Ib11d63e3c388e12f145f40247d17030a566b8c5e
-rw-r--r--glance_store/_drivers/cinder.py2
-rw-r--r--releasenotes/notes/lock_path-cef9d6f5f52c3211.yaml12
2 files changed, 14 insertions, 0 deletions
diff --git a/glance_store/_drivers/cinder.py b/glance_store/_drivers/cinder.py
index feee5ac..8a50862 100644
--- a/glance_store/_drivers/cinder.py
+++ b/glance_store/_drivers/cinder.py
@@ -45,6 +45,7 @@ try:
from cinderclient import api_versions
from cinderclient import exceptions as cinder_exception
from cinderclient.v3 import client as cinderclient
+ import os_brick
from os_brick.initiator import connector
from oslo_privsep import priv_context
except ImportError:
@@ -480,6 +481,7 @@ class Store(glance_store.driver.Store):
else:
self.store_conf = self.conf.glance_store
self.volume_api = cinder_utils.API()
+ getattr(os_brick, 'setup', lambda x: None)(CONF)
def _set_url_prefix(self):
self._url_prefix = "cinder://"
diff --git a/releasenotes/notes/lock_path-cef9d6f5f52c3211.yaml b/releasenotes/notes/lock_path-cef9d6f5f52c3211.yaml
new file mode 100644
index 0000000..bcb13d3
--- /dev/null
+++ b/releasenotes/notes/lock_path-cef9d6f5f52c3211.yaml
@@ -0,0 +1,12 @@
+---
+features:
+ - |
+ When using the cinder backend, a custom os-brick file lock location can be
+ specified using the ``lock_path`` configuration option in the
+ ``[os_brick]`` configuration section. Helpful when deploying on the same
+ host as the Cinder service.
+upgrade:
+ - |
+ When running Cinder and Glance with Cinder backend on the same host an
+ os-brick shared location can be configured using the ``lock_path`` in the
+ ``[os_brick]`` configuration section.