From 8c1a47c9cf6e1001fbefd6ff3b76314e39c81d71 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Thu, 7 Jul 2022 16:22:42 +0200 Subject: [PATCH] Support os-brick specific lock_path Note: Initially this patch was related to new feature, but now it has become a bug since os-brick's `setup` method is not being called and it can create problems if os-brick changes. As a new feature, 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 non backward compatible way, so it requires an os-brick version bump in the requirements. The patch also ensures that ``tox -egenconfig`` includes the os-brick configuration options when generating the sample config. Closes-Bug: #2081859 Change-Id: I1b81eb65bd145869e8cf6f3aabc6ade58f832a19 --- etc/nova/nova-config-generator.conf | 1 + nova/cmd/compute.py | 2 ++ releasenotes/notes/lock_path-7a9f0230f3e25716.yaml | 7 +++++++ requirements.txt | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/lock_path-7a9f0230f3e25716.yaml diff --git a/etc/nova/nova-config-generator.conf b/etc/nova/nova-config-generator.conf index 2f5562c836..b1694402a8 100644 --- a/etc/nova/nova-config-generator.conf +++ b/etc/nova/nova-config-generator.conf @@ -18,3 +18,4 @@ namespace = oslo.versionedobjects namespace = keystonemiddleware.auth_token namespace = osprofiler namespace = os_vif +namespace = os_brick diff --git a/nova/cmd/compute.py b/nova/cmd/compute.py index a433aeb693..3d68892d80 100644 --- a/nova/cmd/compute.py +++ b/nova/cmd/compute.py @@ -19,6 +19,7 @@ import shlex import sys +import os_brick import os_vif from oslo_log import log as logging from oslo_privsep import priv_context @@ -47,6 +48,7 @@ def main(): priv_context.init(root_helper=shlex.split(utils.get_root_helper())) objects.register_all() gmr_opts.set_defaults(CONF) + os_brick.setup(CONF) # Ensure os-vif objects are registered and plugins loaded os_vif.initialize() diff --git a/releasenotes/notes/lock_path-7a9f0230f3e25716.yaml b/releasenotes/notes/lock_path-7a9f0230f3e25716.yaml new file mode 100644 index 0000000000..45a6b18d59 --- /dev/null +++ b/releasenotes/notes/lock_path-7a9f0230f3e25716.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + On HCI deployments where Nova is collocated with the Cinder service or the + Glance using Cinder backend service, an os-brick shared location can be + configured using the ``lock_path`` in the ``[os_brick]`` configuration + section. diff --git a/requirements.txt b/requirements.txt index ba5c4dca53..ee99fa57d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -50,7 +50,7 @@ rfc3986>=1.2.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0 psutil>=3.2.2 # BSD oslo.versionedobjects>=1.35.0 # Apache-2.0 -os-brick>=5.2 # Apache-2.0 +os-brick>=6.0 # Apache-2.0 os-resource-classes>=1.1.0 # Apache-2.0 os-traits>=3.1.0 # Apache-2.0 os-vif>=3.1.0 # Apache-2.0