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
This commit is contained in:
Atsushi Kawai 2023-03-17 05:52:44 +00:00
parent 42d5d1d648
commit 2270611507
2 changed files with 15 additions and 1 deletions

View File

@ -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(

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Hitachi driver `bug #2011810
<https://bugs.launchpad.net/cinder/+bug/2011810>`_: Fixed to use
correct pool number for secondary storage on GAD environment.