From 2270611507720ba5c05bb6acaf0a5825711ba992 Mon Sep 17 00:00:00 2001 From: Atsushi Kawai Date: Fri, 17 Mar 2023 05:52:44 +0000 Subject: [PATCH] Hitachi: Fix to use correct pool on secondary storage This patch fixes to use correct pool number for a secondary storage on GAD environment[*1]. Even though the option ``hitachi_mirror_pool`` is to set pool number for secondary storage, the option does not work and a pool number for primary storage would be used on secondary storage. The bug should be fixed and delete the risk to be used unexpected pool number. [1] GAD is the storage mirroring product on Hitachi storage. The feature was implied as the patch https://review.opendev.org/c/openstack/cinder/+/796170 and was merged into Antelope. Closes-Bug: #2011810 Change-Id: I9c37ada5e6af1f3c28ebd5c3c2a8baf2d88d0a96 --- cinder/volume/drivers/hitachi/hbsd_replication.py | 10 +++++++++- ...ix-to-use-correct-pool-in-GAD-9413a343dcc98029.yaml | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/hitachi-vsp-fix-to-use-correct-pool-in-GAD-9413a343dcc98029.yaml diff --git a/cinder/volume/drivers/hitachi/hbsd_replication.py b/cinder/volume/drivers/hitachi/hbsd_replication.py index b296d853730..6054a97a9ef 100644 --- a/cinder/volume/drivers/hitachi/hbsd_replication.py +++ b/cinder/volume/drivers/hitachi/hbsd_replication.py @@ -237,7 +237,15 @@ class HBSDREPLICATION(rest.HBSDREST): for opt in opts: name = opt.name.replace('hitachi_mirror_', 'hitachi_') try: - setattr(conf, name, getattr(conf, opt.name)) + if opt.name == 'hitachi_mirror_pool': + if conf.safe_get('hitachi_mirror_pool'): + name = 'hitachi_pools' + value = [getattr(conf, opt.name)] + else: + raise ValueError() + else: + value = getattr(conf, opt.name) + setattr(conf, name, value) except Exception: with excutils.save_and_reraise_exception(): self.rep_secondary.output_log( diff --git a/releasenotes/notes/hitachi-vsp-fix-to-use-correct-pool-in-GAD-9413a343dcc98029.yaml b/releasenotes/notes/hitachi-vsp-fix-to-use-correct-pool-in-GAD-9413a343dcc98029.yaml new file mode 100644 index 00000000000..ecfc344747f --- /dev/null +++ b/releasenotes/notes/hitachi-vsp-fix-to-use-correct-pool-in-GAD-9413a343dcc98029.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Hitachi driver `bug #2011810 + `_: Fixed to use + correct pool number for secondary storage on GAD environment.